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 Char String
42 :: BCValue = E.e: BCValue e & mTaskType e
44 instance toString MTaskInterval
45 instance toString MTaskMSGRecv
46 instance toString MTaskMSGSend
47 encode :: MTaskMSGSend -> String
48 decode :: String -> MTaskMSGRecv
77 //Conditionals and jumping
98 derive gPrint BCValue, MTaskDeviceSpec
99 derive consIndex BCValue
100 derive consName BCValue
101 derive conses BCValue
102 derive consNum BCValue
104 derive class gCons Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin
105 derive class iTask UserLED, Long, Pin, Button, AnalogPin, DigitalPin, PinMode, MTaskDeviceSpec
106 derive gEditor BCValue
108 derive JSONEncode BCValue
109 derive JSONDecode BCValue
110 derive gDefault BCValue
113 :: ByteCode a p = BC (RWS () [BC] BCState ())
126 instance zero BCState
128 class toByteCode a :: a -> String
129 class fromByteCode a :: String -> a
130 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
132 instance toByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
133 instance fromByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
134 instance toByteCode MTaskInterval
135 instance fromByteCode MTaskInterval, MTaskDeviceSpec
137 instance arith ByteCode
138 instance boolExpr ByteCode
139 instance analogIO ByteCode
140 instance digitalIO ByteCode
141 instance userLed ByteCode
142 instance If ByteCode Stmt Stmt Stmt
143 instance If ByteCode e Stmt Stmt
144 instance If ByteCode Stmt e Stmt
145 instance If ByteCode x y Stmt
147 instance noOp ByteCode
148 instance retrn ByteCode
150 instance sds ByteCode
151 instance assign ByteCode
152 instance seq ByteCode
153 instance serial ByteCode
155 toMessages :: MTaskInterval (Main (ByteCode a b)) BCState -> ([MTaskMSGSend], BCState)
157 toByteVal :: BC -> String
158 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
159 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)