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
123 instance toByteCode MTaskInterval
124 instance fromByteCode MTaskInterval
127 instance arith ByteCode
128 instance boolExpr ByteCode
129 instance analogIO ByteCode
130 instance digitalIO ByteCode
131 instance userLed ByteCode
132 instance If ByteCode Stmt Stmt Stmt
133 instance If ByteCode e Stmt Stmt
134 instance If ByteCode Stmt e Stmt
135 instance If ByteCode x y Stmt
137 instance noOp ByteCode
139 instance sds ByteCode
140 instance assign ByteCode
141 instance seq ByteCode
142 instance serial ByteCode
144 toMessages :: MTaskInterval (String, BCState) -> ([MTaskMSGSend], BCState)
145 toSDSUpdate :: Int Int -> [MTaskMSGSend]
147 toByteVal :: BC -> String
148 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
149 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)