From: Mart Lubbers Date: Mon, 19 Oct 2015 13:04:40 +0000 (+0200) Subject: started with 7 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=e004bdd08799d2bf65a6f53403183661cac4b544;p=ap2015.git started with 7 --- diff --git a/a7/mart/skeleton7.icl b/a7/mart/skeleton7.icl index 6be3b36..50f7e82 100644 --- a/a7/mart/skeleton7.icl +++ b/a7/mart/skeleton7.icl @@ -1,7 +1,39 @@ module skeleton7 -from iTasks import always, hasValue, :: TaskValue(..), :: Task, :: Stability, :: TaskCont(..), :: Action, updateInformation, viewInformation, class descr, instance descr String, :: UpdateOption, :: ViewOption(..), -||-, -||, ||-, 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, Data.Functor, Control.Applicative, Control.Monad, Data.Map +from iTasks import always, + hasValue, + :: TaskValue(..), + :: Task, + :: Stability, + :: TaskCont(..), + :: Action, + updateInformation, + viewInformation, + class descr, + instance descr String, + :: UpdateOption, + :: ViewOption(..), + -||-, + -||, + ||-, + 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, + Data.Functor, + Control.Applicative, + Control.Monad, + Data.Map import qualified iTasks import qualified Text from Text import class Text, instance Text String @@ -11,35 +43,37 @@ e = Insert New (Oper New +. (Union (Integer 7) (Size (Integer 9)))) :: Expression = New - | Insert Element Set - | Delete Element Set - | Variable Ident - | Union Set Set - | Difference Set Set + | Insert Element Set + | Delete Element Set + | Variable Ident + | Union Set Set + | Difference Set Set | Intersection Set Set - | Integer Int - | Size Set - | Oper Element Op Element - | (=.) infixl 2 Ident Expression + | Integer Int + | Size Set + | Oper Element Op Element + | (=.) infixl 2 Ident Expression -:: Op = +. | -. | *. -:: Set :== Expression +:: Op = +. | -. | *. +:: Set :== Expression :: Element :== Expression :: Ident :== String + // === State +:: Val = Int Int | Set Set +:: State :== Map String Val // === semantics // === simulation -(>>>=) :== 'iTasks'.tbind +(>>>=) :== 'iTasks'.tbind (>>>|) a b :== 'iTasks'.tbind a (\_ -> b) -treturn :== 'iTasks'.return -ActionOk :== 'iTasks'.ActionOk +treturn :== 'iTasks'.return +ActionOk :== 'iTasks'.ActionOk ActionQuit :== 'iTasks'.ActionQuit -ActionNew :== 'iTasks'.ActionNew - +ActionNew :== 'iTasks'.ActionNew Start = Void