Commit 89409ebb authored by Tim Steenvoorden's avatar Tim Steenvoorden

remember last run task

parent fe254a7c
Pipeline #25082 passed with stage
in 5 minutes and 52 seconds
......@@ -15,17 +15,17 @@ import iTasks.Extensions.Editors.DynamicEditor
// Main ////////////////////////////////////////////////////////////////////////
Start world = doTasks editTask world
editTask =
forever
( enterInformation ("Contruct a task", info1) [EnterUsing id $ dynamicEditor taskEditor]
>>= \v ->
viewInformation ("Evaluate the task", info2) [] ()
||- (evalTaskConstExpr (toValue taskEditor v) <<@ ApplyLayout frameCompact)
>>= viewInformation ("Done!", info3) []
>>= return
)
Start world = doTasks (editTask Nothing) world
editTask :: (Maybe (DynamicEditorValue TaskExpr)) -> Task (Maybe (DynamicEditorValue TaskExpr))
editTask mv =
enterOrUpdate ("Contruct a task", info1) mv
>>= \v ->
viewInformation ("Evaluate the task", info2) [] ()
||- (evalTaskConstExpr (toValue taskEditor v) <<@ ApplyLayout frameCompact)
>>= viewInformation ("Done!", info3) []
>>= return
>>| editTask (Just v)
where
info1 :: String
info1 = "Select the editors and combinators you'd like to use. When you're ready, push the 'Continue' button below to run your program."
......@@ -34,6 +34,9 @@ where
info3 :: String
info3 = "The program is done, the result is given below."
enterOrUpdate msg Nothing = enterInformation msg [EnterUsing id $ dynamicEditor taskEditor]
enterOrUpdate msg (Just v) = updateInformation msg [UpdateUsing id (curry fst) (dynamicEditor taskEditor)] v
// Data ////////////////////////////////////////////////////////////////////////
......
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