always, hasValue, :: TaskValue(..), :: Task, :: Stability,
:: TaskCont(..), :: Action, updateInformation, viewInformation,
class descr, instance descr String, :: UpdateOption, :: ViewOption(..),
- -||-, -||, ||-, startEngine, class Publishable, >>*, class TFunctor,
+ -||-, -||, ||- , startEngine, class Publishable, >>*, class TFunctor,
instance TFunctor Task, class TApplicative, instance TApplicative Task,
instance Publishable Task, Void
import Data.Tuple, StdClass, StdList, iTasks._Framework.Generic, Text.JSON,
from Text import class Text, instance Text String
from StdFunc import o
-e = Insert New (Oper New +. (Union (Integer 7) (Size (Integer 9))))
+e = New
:: Expression
= New
ActionQuit :== 'iTasks'.ActionQuit
ActionNew :== 'iTasks'.ActionNew
-mainTask = viewInformation (print e)
+expressionLens :: Expression -> String
+expressionLens e = case evalExpr e newMap of
+ (Left s) = "Error: " +++ s
+ (Right (Set s)) = "{" +++ ('Text'.join ", " (map toString s)) +++ "}"
+ (Right (Int i)) = toString i
+
+mainTask = updateInformation "Expression enter" [] e
+ >>* [OnAction ActionOk (hasValue (viewInformation "Expression view" [ViewWith expressionLens]))]
+
+derive class iTask Expression, Op, Val
Start :: *World -> *World
Start world = startEngine mainTask world