Commit 35d777b9 authored by Tim Steenvoorden's avatar Tim Steenvoorden

simplify things

parent 4ef80491
...@@ -361,14 +361,10 @@ evalTaskExpr (Then task taskFunc) = evalTaskExpr task >>= evalTaskFunc taskFunc ...@@ -361,14 +361,10 @@ evalTaskExpr (Then task taskFunc) = evalTaskExpr task >>= evalTaskFunc taskFunc
evalTaskExpr (Both task1 task2) = (evalTaskExpr task1 -&&- evalTaskExpr task2) <<@ ApplyLayout arrangeHorizontal @ \(a, b) -> VTuple a b evalTaskExpr (Both task1 task2) = (evalTaskExpr task1 -&&- evalTaskExpr task2) <<@ ApplyLayout arrangeHorizontal @ \(a, b) -> VTuple a b
evalTaskExpr (Any task1 task2) = (evalTaskExpr task1 -||- evalTaskExpr task2) <<@ ApplyLayout arrangeHorizontal evalTaskExpr (Any task1 task2) = (evalTaskExpr task1 -||- evalTaskExpr task2) <<@ ApplyLayout arrangeHorizontal
evalTaskExpr (One button1 task1 button2 task2) evalTaskExpr (One button1 task1 button2 task2)
= viewInformation "Make a choice" [] () >>* = viewInformation "Make a choice" [] () >?>
[ OnAction (Action button1) (ifValue (const True) (\_ -> evalTaskExpr task1)) [ ( button1, const True, \_ -> evalTaskExpr task1 )
, OnAction (Action button2) (ifValue (const True) (\_ -> evalTaskExpr task2)) , ( button2, const True, \_ -> evalTaskExpr task2 )
] ]
evalTaskExpr x = abort $ "My brain hurts!" +++ unlines (gText{|*|} AsMultiLine (Just x))
where
unlines :: [String] -> String
unlines xs = foldr (\x acc -> x +++ "\n" +++ acc) "" xs
// evalTaskExpr (When task1 options) = evalTaskExpr task1 // evalTaskExpr (When task1 options) = evalTaskExpr task1
// >>* [ OnAction (Action name) (ifValue (test pred) (evalTaskFunc cont)) // >>* [ OnAction (Action name) (ifValue (test pred) (evalTaskFunc cont))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment