class sds v where
sds :: ((v t Upd)->In t (Main (v c s))) -> (Main (v c s)) | type, toByteCode, toCode t
con :: ((v t Expr) ->In t (Main (v c s))) -> (Main (v c s)) | type t
+ pub :: (v t Upd) -> v t Expr | type t
class seq v where
(>>=.) infixr 0 :: (v t p) ((v t Expr) -> (v u q)) -> (v u Stmt) | type t & type u
(:.) infixr 0 :: (v t p) (v u q) -> v u Stmt | type t & type u
in setCode Var +.+ c (type2string v + " " + name + " = " + toCode v +
";\n") +.+ setCode Setup +.+ unMain body}
con f = defCode f
-// pub _ = undef
+ pub _ = undef
defCode :: ((Code t p) -> In t (Main (Code u q))) -> Main (Code u r) | type t
defCode f =
instance seq ByteCode
instance serial ByteCode
-pub :: (ByteCode a b) -> ByteCode a b
+//pub :: (ByteCode a b) -> ByteCode a b
toMessages :: Int (String, BCState) -> [MTaskMessage]
retrn :: ([BC] -> ByteCode a p)
retrn = BC o tuple
-fmp :: ([BC] -> [BC]) (ByteCode a p) -> ByteCode a p
+fmp :: ([BC] -> [BC]) (ByteCode a p) -> ByteCode a q
fmp f b = BC \s->let (bc, s`) = runBC b s in (f bc, s`)
instance toByteCode Bool where
in setSDS sds v <++> unMain body
}
con f = undef
+ pub x = fmp makePub x
// pub _ = undef
instance assign ByteCode where
sds \y=4 In
{main = If (y ==. lit 0) (pub x) (x =. x *. y :. y =. y -. lit 1)}
-pub :: (ByteCode a b) -> ByteCode a b
-pub x = fmp makePub x
+//pub :: (ByteCode a b) -> ByteCode a b
+//pub x = fmp makePub x
to16bit :: Int -> String
to16bit i = toString (toChar (i/265)) +++ toString (toChar (i rem 265))
instance sds Eval where
sds f = defEval f
con f = defEval f
-// pub _ = undef
+ pub _ = undef
defEval :: ((Eval t p)->In t (Main (Eval u q))) -> (Main (Eval u q)) | dyn t
defEval f =
import StdDebug, StdMisc
from Text import class Text(concat,join,split), instance Text String
-from Control.Monad import mapM
import iTasks
import mTask
Start :: *World -> *World
Start world = startEngine (
- withShared ([], False, [], False) (\ch->
- enterInformation "Port Number?" [] >>= \port->mTaskTask port ch
- )) world
+ enterInformation "Port Number?" []
+ >>= \port->withShared ([], False, [], False) (mTaskTask port)
+ ) world
//Start world = startEngine mTaskTask world
mTaskTask :: Int (Shared ([MTaskMessage],Bool,[MTaskMessage],Bool)) -> Task ()