Commit bc049c02 authored by Tim Steenvoorden's avatar Tim Steenvoorden

simplify main interface

parent ae86543e
...@@ -7,21 +7,30 @@ import Text ...@@ -7,21 +7,30 @@ import Text
import iTasks import iTasks
import iTasks.Extensions.Editors.DynamicEditor import iTasks.Extensions.Editors.DynamicEditor
// Synonyms ////////////////////////////////////////////////////////////////////
:: List a :== [a] :: List a :== [a]
// Main ////////////////////////////////////////////////////////////////////////
Start world = doTasks editTask world Start world = doTasks editTask world
editTask = editTask =
forever forever
( viewInformation "Contruct a Task expression:" [] () ( enterInformation ("Contruct a task", info) [EnterUsing id $ dynamicEditor taskEditor]
||- enterInformation () [EnterUsing id $ dynamicEditor taskEditor]
>>= \v -> >>= \v ->
viewInformation "Evaluate the Expression:" [] () viewInformation ("Evaluate the task", "") [] ()
||- evalTaskConstExpr (toValue taskEditor v) ||- (evalTaskConstExpr (toValue taskEditor v) <<@ ApplyLayout frameCompact)
>>= viewInformation "Result of the Task is:" [] >>= viewInformation ("Done!", "") []
>>= return >>= return
) // <<@ ApplyLayout frameCompact )
where
info = "Select the editors and combinators you'd like to use. When you're ready, push the 'Continue' button below to run your program."
// Data ////////////////////////////////////////////////////////////////////////
:: TaskConstExpr :: TaskConstExpr
= Apply TaskFuncExpr Expr = Apply TaskFuncExpr Expr
...@@ -65,8 +74,8 @@ editTask = ...@@ -65,8 +74,8 @@ editTask =
derive class iTask TaskConstExpr, TaskFuncExpr, Expr, Value, Typed, FunExpr derive class iTask TaskConstExpr, TaskFuncExpr, Expr, Value, Typed, FunExpr
// These instances cannot be auto derived because of the existential quantifier.
// instances are never used // However, they will be never used, so we make them undefined.
gDefault{|Ty|} = undef gDefault{|Ty|} = undef
gEq{|Ty|} _ _ = undef gEq{|Ty|} _ _ = undef
JSONEncode{|Ty|} _ _ = undef JSONEncode{|Ty|} _ _ = undef
...@@ -75,6 +84,8 @@ gText{|Ty|} _ _ = undef ...@@ -75,6 +84,8 @@ gText{|Ty|} _ _ = undef
gEditor{|Ty|} = undef gEditor{|Ty|} = undef
// Editor //////////////////////////////////////////////////////////////////////
taskEditor :: DynamicEditor TaskConstExpr taskEditor :: DynamicEditor TaskConstExpr
taskEditor = DynamicEditor conses taskEditor = DynamicEditor conses
where where
......
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