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 ())
116 instance zero BCState
118 class toByteCode a :: a -> String
119 class fromByteCode a :: String -> a
120 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
122 instance toByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
123 instance fromByteCode Int, Bool, Char, Long, String, Button, UserLED
124 instance toByteCode MTaskInterval
125 instance fromByteCode MTaskInterval
128 instance arith ByteCode
129 instance boolExpr ByteCode
130 instance analogIO ByteCode
131 instance digitalIO ByteCode
132 instance userLed ByteCode
133 instance If ByteCode Stmt Stmt Stmt
134 instance If ByteCode e Stmt Stmt
135 instance If ByteCode Stmt e Stmt
136 instance If ByteCode x y Stmt
138 instance noOp ByteCode
140 instance sds ByteCode
141 instance assign ByteCode
142 instance seq ByteCode
143 instance serial ByteCode
145 toMessages :: MTaskInterval (String, BCState) -> ([MTaskMSGSend], BCState)
146 toSDSUpdate :: Int Int -> [MTaskMSGSend]
148 toByteVal :: BC -> String
149 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
150 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)