Commit 8f64b616 authored by Tim Steenvoorden's avatar Tim Steenvoorden

add forever task

parent 64825291
Pipeline #25358 failed with stage
in 59 seconds
...@@ -61,6 +61,7 @@ where ...@@ -61,6 +61,7 @@ where
// | Init Ty TaskExpr // | Init Ty TaskExpr
| Watch String | Watch String
// | Change String // | Change String
| Forever TaskExpr
:: TaskFunc :: TaskFunc
= ThenF TaskFunc TaskFunc = ThenF TaskFunc TaskFunc
...@@ -231,7 +232,7 @@ taskEditor = DynamicEditor ...@@ -231,7 +232,7 @@ taskEditor = DynamicEditor
) )
<<@@@ applyHorizontalBoxedLayout <<@@@ applyHorizontalBoxedLayout
] ]
// Non-task functions: // Task expressions and functions on shares
, DynamicConsGroup "Shares" , DynamicConsGroup "Shares"
// [ functionConsDyn "Init" "initialise" // [ functionConsDyn "Init" "initialise"
// ( dynamic \(Typed sharedTy) (Typed taskExpr) -> Typed (Init sharedTy taskExpr) :: // ( dynamic \(Typed sharedTy) (Typed taskExpr) -> Typed (Init sharedTy taskExpr) ::
...@@ -262,6 +263,15 @@ taskEditor = DynamicEditor ...@@ -262,6 +263,15 @@ taskEditor = DynamicEditor
<<@@@ applyHorizontalBoxedLayout <<@@@ applyHorizontalBoxedLayout
<<@@@ AddLabels [ Just "message" ] <<@@@ AddLabels [ Just "message" ]
] ]
, DynamicConsGroup "Special"
[ functionConsDyn "Forever" "repeat forever"
( dynamic \(Typed taskExpr) -> Typed (Forever taskExpr) ::
A.a:
(Typed TaskExpr (Task a))
-> Typed TaskExpr (Task a)
)
<<@@@ applyVerticalBoxedLayout
]
// Non-task functions: // Non-task functions:
, DynamicConsGroup "Basics" , DynamicConsGroup "Basics"
[ functionConsDyn "Identity" "this value" [ functionConsDyn "Identity" "this value"
...@@ -411,6 +421,7 @@ evalTaskExpr (One button1 task1 button2 task2) = viewInformation "Make a choice" ...@@ -411,6 +421,7 @@ evalTaskExpr (One button1 task1 button2 task2) = viewInformation "Make a choice"
] ]
// evalTaskExpr (Init sharedTy task) = set ( sharedTy, [] ) globalValueShare >>| evalTaskExpr task // evalTaskExpr (Init sharedTy task) = set ( sharedTy, [] ) globalValueShare >>| evalTaskExpr task
evalTaskExpr (Watch msg) = viewSharedInformation msg [] globalValueShare @ (const VUnit) evalTaskExpr (Watch msg) = viewSharedInformation msg [] globalValueShare @ (const VUnit)
evalTaskExpr (Forever task) = forever (evalTaskExpr task)
// 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