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
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 ())
127 instance zero BCState
129 class toByteCode a :: a -> String
130 class fromByteCode a :: String -> a
131 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
133 instance toByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
134 instance fromByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
135 instance toByteCode MTaskInterval
136 instance fromByteCode MTaskInterval, MTaskDeviceSpec
138 instance arith ByteCode
139 instance boolExpr ByteCode
140 instance analogIO ByteCode
141 instance digitalIO ByteCode
142 instance userLed ByteCode
143 instance If ByteCode Stmt Stmt Stmt
144 instance If ByteCode e Stmt Stmt
145 instance If ByteCode Stmt e Stmt
146 instance If ByteCode x y Stmt
148 instance noOp ByteCode
149 instance retrn ByteCode
151 instance sds ByteCode
152 instance assign ByteCode
153 instance seq ByteCode
154 instance serial ByteCode
156 toMessages :: MTaskInterval (Main (ByteCode a b)) BCState -> ([MTaskMSGSend], BCState)
158 toByteVal :: BC -> String
159 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
160 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)