1 definition module mTaskInterpret
5 from Data.Functor.Identity import :: Identity
6 from Control.Monad.State import :: State, :: StateT
7 from Control.Monad.RWST import :: RWST, :: RWS
8 from Data.Either import :: Either
9 from iTasks._Framework.Generic.Defaults import generic gDefault
10 from GenPrint import generic gPrint
11 from Generics.gCons import class gCons, generic conses, generic consName, generic consIndex, generic consNum
20 | MTDevSpec MTaskDeviceSpec
24 = MTTask MTaskInterval String
39 ,maxTask :: Int //Should be number of bytes reserved in total for shares, tasks and functions
43 :: BCValue = E.e: BCValue e & mTaskType e
45 instance toString MTaskInterval
46 instance toString MTaskMSGRecv
47 instance toString MTaskMSGSend
48 encode :: MTaskMSGSend -> String
49 decode :: String -> MTaskMSGRecv
77 //Conditionals and jumping
97 derive gPrint BCValue, MTaskDeviceSpec
98 derive consIndex BCValue
99 derive consName BCValue
100 derive conses BCValue
101 derive consNum BCValue
103 derive class gCons Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin
104 derive class iTask UserLED, Long, Pin, Button, AnalogPin, DigitalPin, PinMode, MTaskDeviceSpec
105 derive gEditor BCValue
107 derive JSONEncode BCValue
108 derive JSONDecode BCValue
109 derive gDefault BCValue
112 :: ByteCode a p = BC (RWS () [BC] BCState ())
125 instance zero BCState
127 class toByteCode a :: a -> String
128 class fromByteCode a :: String -> a
129 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
131 instance toByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
132 instance fromByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
133 instance toByteCode MTaskInterval
134 instance fromByteCode MTaskInterval, MTaskDeviceSpec
136 instance arith ByteCode
137 instance boolExpr ByteCode
138 instance analogIO ByteCode
139 instance digitalIO ByteCode
140 instance userLed ByteCode
141 instance If ByteCode Stmt Stmt Stmt
142 instance If ByteCode e Stmt Stmt
143 instance If ByteCode Stmt e Stmt
144 instance If ByteCode x y Stmt
146 instance noOp ByteCode
148 instance sds ByteCode
149 instance assign ByteCode
150 instance seq ByteCode
151 instance serial ByteCode
153 toMessages :: MTaskInterval (Main (ByteCode a b)) BCState -> ([MTaskMSGSend], BCState)
154 toSDSUpdate :: Int Int -> [MTaskMSGSend]
156 toByteVal :: BC -> String
157 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
158 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)