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
23 = MTTask MTaskInterval String
33 :: BCValue = E.e: BCValue e & mTaskType e
35 instance toString MTaskInterval
36 instance toString MTaskMSGRecv
37 instance toString MTaskMSGSend
38 encode :: MTaskMSGSend -> String
39 decode :: String -> MTaskMSGRecv
67 //Conditionals and jumping
88 derive consIndex BCValue
89 derive consName BCValue
91 derive consNum BCValue
93 derive class gCons Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin
94 derive class iTask UserLED, Long, Pin, Button, AnalogPin, DigitalPin, PinMode
95 derive gEditor BCValue
97 derive JSONEncode BCValue
98 derive JSONDecode BCValue
99 derive gDefault BCValue
102 :: ByteCode a p = BC (RWS () [BC] BCState ())
115 instance zero BCState
117 class toByteCode a :: a -> String
118 class fromByteCode a :: String -> a
119 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
121 instance toByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
122 instance fromByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
123 instance toByteCode MTaskInterval
124 instance fromByteCode MTaskInterval
126 instance arith ByteCode
127 instance boolExpr ByteCode
128 instance analogIO ByteCode
129 instance digitalIO ByteCode
130 instance userLed ByteCode
131 instance If ByteCode Stmt Stmt Stmt
132 instance If ByteCode e Stmt Stmt
133 instance If ByteCode Stmt e Stmt
134 instance If ByteCode x y Stmt
136 instance noOp ByteCode
138 instance sds ByteCode
139 instance assign ByteCode
140 instance seq ByteCode
141 instance serial ByteCode
143 toMessages :: MTaskInterval (String, BCState) -> ([MTaskMSGSend], BCState)
144 toSDSUpdate :: Int Int -> [MTaskMSGSend]
146 toByteVal :: BC -> String
147 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
148 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)