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
43 :: BCValue = E.e: BCValue e & mTaskType e
45 instance toString MTaskInterval
46 instance toString MTaskMSGRecv
47 instance toString MTaskMSGSend
48 encode :: MTaskMSGSend -> String
49 decode :: String -> MTaskMSGRecv
60 | BCSdsPublish BCShare
78 //Conditionals and jumping
99 derive gPrint BCValue, MTaskDeviceSpec
100 derive consIndex BCValue
101 derive consName BCValue
102 derive conses BCValue
103 derive consNum BCValue
105 derive class gCons Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin
106 derive class iTask UserLED, Long, Pin, Button, AnalogPin, DigitalPin, PinMode, MTaskDeviceSpec
107 derive gEditor BCValue
109 derive JSONEncode BCValue
110 derive JSONDecode BCValue
111 derive gDefault BCValue
114 :: 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 aIO ByteCode
142 instance dIO ByteCode
143 instance userLed ByteCode
144 instance If ByteCode Stmt Stmt Stmt
145 instance If ByteCode e Stmt Stmt
146 instance If ByteCode Stmt e Stmt
147 instance If ByteCode x y Stmt
149 instance noOp ByteCode
150 instance retrn ByteCode
152 instance sds ByteCode
153 instance assign ByteCode
154 instance seq ByteCode
155 instance serial ByteCode
157 toMessages :: MTaskInterval (Main (ByteCode a b)) BCState -> ([MTaskMSGSend], BCState)
159 toByteVal :: BC -> String
160 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
161 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)