,bytesMemory :: Int
}
-:: BCValue = E.e: BCValue e & mTaskType e
+:: BCValue = E.e: BCValue e & mTaskType, TC e
+
+instance == BCValue
instance toString MTaskInterval
instance toString MTaskMSGRecv
import Tasks.Examples
+instance == BCValue where (==) a b = toByteCode a == toByteCode b
+
encode :: MTaskMSGSend -> String
encode (MTTask to data) = "t" +++ toByteCode to +++ to16bit (size data) +++ data +++ "\n"
encode (MTTaskDel i) = "d" +++ to16bit i +++ "\n"
pred [x:_] = not $ isEmpty x.deviceShares
cont :: MTaskDevice -> Task ()
- cont dev = updateSharedInformation "Blinkyblink" [] (getRealShare dev (hd dev.deviceShares))
- >>* [OnAction ActionContinue (const $ Just $ cont dev)]
-
+ cont dev
+ # rs = getRealShare dev (hd dev.deviceShares)
+ = get rs >>= \oldvalue->
+ forever (updateSharedInformation "Blinkyblink" [] (getRealShare dev (hd dev.deviceShares))
+ >>* [OnAction ActionContinue (const $ Just $ treturn ())])
+ -|| (wait "bigger than 10" (\x->x == oldvalue) rs
+ >>= viewInformation "Bigger:)" [])
+
+ toInt :: BCValue -> Int
+ toInt (BCValue e) = dynToInt (dynamic e)
+
+ dynToInt :: Dynamic -> Int
+ dynToInt (a :: Int) = a
+ dynToInt x = abort "Not an int"
mTaskManager :: Task ()
mTaskManager = (>>|) startupDevices $