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
46 :: BCValue = E.e: BCValue e & mTaskType, TC e
50 instance toString MTaskInterval
51 instance toString MTaskMSGRecv
52 instance toString MTaskMSGSend
53 encode :: MTaskMSGSend -> String
54 decode :: String -> MTaskMSGRecv
65 | BCSdsPublish BCShare
83 //Conditionals and jumping
104 derive gPrint BCValue, MTaskDeviceSpec
105 derive consIndex BCValue
106 derive consName BCValue
107 derive conses BCValue
108 derive consNum BCValue
110 derive class gCons Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin
111 derive class iTask UserLED, Long, Pin, Button, AnalogPin, DigitalPin, PinMode, MTaskDeviceSpec
112 derive gEditor BCValue
114 derive JSONEncode BCValue
115 derive JSONDecode BCValue
116 derive gDefault BCValue
119 :: ByteCode a p = BC (RWS () [BC] BCState ())
131 instance zero BCState
133 class toByteCode a :: a -> String
134 class fromByteCode a :: String -> a
135 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
137 instance toByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
138 instance fromByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
139 instance toByteCode MTaskInterval
140 instance fromByteCode MTaskInterval, MTaskDeviceSpec
142 instance arith ByteCode
143 instance boolExpr ByteCode
144 instance analogIO ByteCode
145 instance digitalIO ByteCode
146 instance aIO ByteCode
147 instance dIO ByteCode
148 instance userLed ByteCode
149 instance If ByteCode Stmt Stmt Stmt
150 instance If ByteCode e Stmt Stmt
151 instance If ByteCode Stmt e Stmt
152 instance If ByteCode x y Stmt
154 instance noOp ByteCode
155 instance retrn ByteCode
157 instance sds ByteCode
158 instance sdspub ByteCode
159 instance assign ByteCode
160 instance seq ByteCode
161 instance serial ByteCode
163 toMessages :: MTaskInterval (Main (ByteCode a b)) BCState -> ([MTaskMSGSend], BCState)
165 toByteVal :: BC -> String
166 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
167 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)