definition module mTaskInterpret from Data.Functor.Identity import :: Identity from Control.Monad.State import :: State, :: StateT import mTask :: BC = BCNop | BCLab Int | BCPush [Char] | BCPop //SDS functions | BCSdsStore Int | BCSdsFetch Int | BCSdsPublish Int //Unary ops | BCNot //Binary Int ops | BCAdd | BCSub | BCMul | BCDiv //Binary Bool ops | BCAnd | BCOr | BCEq | BCNeq | BCLes | BCGre | BCLeq | BCGeq //Conditionals and jumping | BCJmp Int | BCJmpT Int | BCJmpF Int //Serial | BCSerialAvail | BCSerialPrint | BCSerialPrintln | BCSerialRead | BCSerialParseInt //Pins | BCAnalogRead Pin | BCAnalogWrite Pin | BCDigitalRead Pin | BCDigitalWrite Pin | BCTest AnalogPin :: ByteCode a p = BC (BCState -> ([BC], BCState)) //:: ByteCode a p = BC [BC] //:: ByteCode a p = BC ((ReadWrite (ByteCode a Expr)) BCState -> ([BC], BCState)) :: BCState = { freshl :: [Int], freshs :: [Int] } class toByteCode a :: a -> [Char] instance toByteCode Int instance toByteCode Bool instance toByteCode Char instance toByteCode String instance toByteCode Long instance toByteCode Button toByteVal :: BC -> [Char]