repositories
/
ap2015.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c189c39
)
start met iTask
author
Mart Lubbers
<mart@martlubbers.net>
Sun, 8 Nov 2015 12:02:25 +0000
(13:02 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Sun, 8 Nov 2015 12:02:25 +0000
(13:02 +0100)
a7/mart/skeleton7.icl
patch
|
blob
|
history
diff --git
a/a7/mart/skeleton7.icl
b/a7/mart/skeleton7.icl
index
5281d10
..
2aedd83
100644
(file)
--- a/
a7/mart/skeleton7.icl
+++ b/
a7/mart/skeleton7.icl
@@
-4,7
+4,7
@@
from iTasks import
always, hasValue, :: TaskValue(..), :: Task, :: Stability,
:: TaskCont(..), :: Action, updateInformation, viewInformation,
class descr, instance descr String, :: UpdateOption, :: ViewOption(..),
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,
instance TFunctor Task, class TApplicative, instance TApplicative Task,
instance Publishable Task, Void
import Data.Tuple, StdClass, StdList, iTasks._Framework.Generic, Text.JSON,
@@
-16,7
+16,7
@@
import StdTuple
from Text import class Text, instance Text String
from StdFunc import o
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
:: Expression
= New
@@
-141,7
+141,16
@@
ActionOk :== 'iTasks'.ActionOk
ActionQuit :== 'iTasks'.ActionQuit
ActionNew :== 'iTasks'.ActionNew
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
Start :: *World -> *World
Start world = startEngine mainTask world