From e004bdd08799d2bf65a6f53403183661cac4b544 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Mon, 19 Oct 2015 15:04:40 +0200 Subject: [PATCH] started with 7 --- a7/mart/skeleton7.icl | 70 ++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 18 deletions(-) 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 -- 2.20.1