- onConnect _ (received,receiveStopped,send,sendStopped)
- = (Ok "",if (not (isEmpty send)) (Just (received,False,[],sendStopped)) Nothing, map encodeFun send,False)
- whileConnected Nothing acc (received,receiveStopped,send,sendStopped)
- = (Ok acc, Nothing, [], False)
- whileConnected (Just newData) acc (received,receiveStopped,send,sendStopped)
- # [acc:msgs] = reverse (split msgSeparator (concat [acc,newData]))
- # write = if (not (isEmpty msgs && isEmpty send))
- (Just (received ++ map decodeFun (reverse msgs),receiveStopped,[],sendStopped))
- Nothing
- = (Ok acc,write,map encodeFun send,False)
-
- onDisconnect l (received,receiveStopped,send,sendStopped)
- = (Ok l,Just (received,True,send,sendStopped))
-
-consumeNetworkStream :: ([m] -> Task ()) (Shared ([m],Bool,[m],Bool)) -> Task () | iTask m
-consumeNetworkStream processTask channel
- = ((watch channel >>* [OnValue (ifValue ifProcess process)]) <! id) @! ()
+ pred [] = False
+ pred [x:_] = not $ isEmpty x.deviceShares
+
+ cont :: MTaskDevice -> Task ()
+ 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 $
+ viewmTasks ||-
+ ((manageShares ||- whileUnchanged deviceStoreNP (manageDevices process))
+ <<@ ArrangeSplit Vertical True)
+ <<@ ArrangeWithSideBar 0 LeftSide 260 True