--- /dev/null
+definition module mTaskInterpret
+
+import mTask
+
+:: BC
+ = BCNop
+ | BCPush Int
+ | BCPop
+ //Unary ops
+ | BCNeg
+ | BCNot
+ //Binary Int ops
+ | BCAdd
+ | BCSub
+ | BCMul
+ | BCDiv
+
+:: ByteCode a p = BC ((ReadWrite a) BCState -> ([BC], BCState))
+:: BCState = {
+ a::()
+ }
+
+toByteVal :: BC -> String
+toReadableByteVal :: BC -> String
+
+//instance toCode Pin
+//instance toCode MTask
+//instance toCode ()
+//instance toCode Long
+//
+//class toCode a :: a -> String
+//instance toCode Bool
+//instance toCode Int
+//instance toCode Real
+//instance toCode Char
+//instance toCode String
+//instance toCode DigitalPin
+//instance toCode AnalogPin
+//
+//argType :: (((Code a p)->Code b q)->In ((Code a p)->Code b q) (Code c s)) -> a | type a
+//
+//class argTypes t :: ((t->Code b Expr)->In (t->Code b2 q) (Main (Code c s))) -> t
+//instance argTypes (Code a p) | showType a
+//instance argTypes (Code a p, Code b q) | showType a & showType b
+//instance argTypes (Code a p, Code b q, Code c r) | showType a & showType b & showType c
+//
+//instance toCode (SV t)
+//
+//instance arith Code
+//instance boolExpr Code
+//instance If Code Stmt Stmt Stmt
+//instance If Code e Stmt Stmt
+//instance If Code Stmt e Stmt
+//instance If Code x y Expr
+//instance IF Code
+//instance sds Code
+//
+//defCode :: ((Code t p) -> In t (Main (Code u q))) -> Main (Code u r) | type t
+//
+//var :: String (ReadWrite (Code v q)) CODE -> CODE
+//
+//instance assign Code
+//instance seq Code
+//instance step` Code
+//codeSteps :: [Step Code t] -> Code u p
+//optBreak :: Mode -> Code u p
+//
+//instance setDelay Code
+//instance mtask Code a | taskImp2 a & types a
+//instance mtasks Code a b | taskImp2 a & types a & taskImp2 b & types b
+//
+//loopCode :: Int (Code a b) -> Code c d
+//
+//class taskImp2 a :: Int a -> ((Code Long p) a->Code MTask Expr, a) | /*long Code delay &*/ isExpr p
+//instance taskImp2 ()
+//instance taskImp2 (Code t p)
+//instance taskImp2 (Code a p, Code b q)
+//instance taskImp2 (Code a p, Code b q, Code c r)
+//instance taskImp2 (Code a p, Code b q, Code c r, Code d s)
+//
+//class taskImp a :: Int a -> (Int a->Code MTask Expr, a)
+//instance taskImp ()
+//instance taskImp (Code t p)
+//instance taskImp (Code a p, Code b q)
+//instance taskImp (Code a p, Code b q, Code c r)
+//instance taskImp (Code a p, Code b q, Code c r, Code d s)
+//
+//tasksMain :: Int Int ((a->Code MTask Expr,b->Code MTask Expr) -> In (a->Code c d,b->Code e f) (Main (Code g h))) -> Main (Code i j) | taskImp a & types a & taskImp b & types b
+//class types a :: a
+//instance types ()
+//instance types (Code a p) | typeSelector a & isExpr p
+//instance types (Code a p, Code b q) | typeSelector a & isExpr p & typeSelector b & isExpr q
+//instance types (Code a p, Code b q, Code c r) | typeSelector a & isExpr p & typeSelector b & isExpr q & typeSelector c & isExpr r
+//instance types (Code a p, Code b q, Code c r, Code d s) | typeSelector a & isExpr p & typeSelector b & isExpr q & typeSelector c & isExpr r & typeSelector d & isExpr s
+//
+//codeMTaskBody :: (Code v w) (Code c d) -> Code e f
+//instance fun Code ()
+//instance fun Code (Code t p) | type, showType t & isExpr p
+//instance fun Code (Code a p, Code b q) | showType a & showType b
+//instance fun Code (Code a p, Code b q, Code c r) | showType a & showType b & showType c
+//instance output Code
+//instance pinMode Code
+//instance digitalIO Code
+//instance dIO Code
+//instance aIO Code
+//instance analogIO Code
+//instance noOp Code
+//
+//:: Code a p = C ((ReadWrite (Code a Expr)) CODE -> CODE)
+//:: CODE =
+// { fresh :: Int
+// , freshMTask :: Int
+// , funs :: [String]
+// , ifuns :: Int
+// , vars :: [String]
+// , ivars :: Int
+// , setup :: [String]
+// , isetup :: Int
+// , loop :: [String]
+// , iloop :: Int
+// , includes :: [String]
+// , def :: Def
+// , mode :: Mode
+// , binds :: [String]
+// }
+//
+//unC :: (Code a p) -> ((ReadWrite (Code a Expr)) CODE -> CODE)
+//
+//:: Def = Var | Fun | Setup | Loop
+//:: Mode = /*MainMode |*/ NoReturn | Return String | SubExp | Assign String
+//
+//setMode :: Mode -> Code a p
+//getMode :: (Mode -> Code a p) -> Code a p
+//embed :: (Code a p) -> Code a p
+//(+.+) infixl 5 :: (Code a p) (Code b q) -> Code c r
+//fresh :: (Int -> (Code a p)) -> (Code a p)
+//freshMTask :: (Int -> (Code a p)) -> (Code a p)
+//setCode :: Def -> (Code a p)
+//getCode :: (Def -> Code a p) -> (Code a p)
+//brac :: (Code a p) -> Code b q
+//funBody :: (Code a p) -> Code b q
+//codeOp2 :: (Code a p) String (Code b q) -> Code c r
+//include :: String -> Code a b
+//argList :: [a] -> String | toCode a
+//c :: a -> Code b p | toCode a
+//indent :: Code a p
+//unindent :: Code a p
+//nl :: Code a p
+//setBinds :: [String] -> Code a p
+//addBinds :: String -> Code a p
+//getBinds :: ([String] -> Code a p) -> (Code a p)
+//
+//// ----- driver ----- //
+//
+//compile :: (Main (Code a p)) -> [String]
+//mkset :: [a] -> [a] | Eq a
+//newCode :: CODE