6 import iTasks.Extensions.DateTime
7 import iTasks.UI.Layout.Minimal
9 Start w = doTasksWithOptions opt w2 w
14 t2 = enterInformation () [] >>= viewInformation () []
16 t3 = withShared 3 \sh->
17 withTemporaryDirectory (viewInformation () [])
18 >>= viewInformation () []
19 t4 = updateInformation () [] 42
21 t5 = sequence [return i\\i<-[0..1000]] >>= viewInformation () []
25 t7 i = viewInformation () [] i >>= \x->t7 (x + 1)
27 t8 = viewInformation () [] 1
28 >>= \_->(viewInformation () [] 2
29 >>= \_->viewInformation () [] 3
30 >>= \_->viewInformation () [] 4)
32 p = parallel [(Embedded, \_->waitForTimer 5)] []
33 p1 = waitForTimer 5 -||- waitForTimer 10
34 p2 = withShared 3 \sh->watch sh
36 w1 = withShared 0 \sds -> (watch sds @? trace_stdout) -&&- updateInformation () [] 0 -&&- updateSharedInformation () [] sds
38 w2 = withShared 0 \sds ->
39 updateSharedInformation () [] sds
40 -&&- (whileUnchanged sds (viewInformation () []) @? trace_stdout)
42 w3 = forever (viewInformation () [] 32) @? trace_stdout
45 // opt args eo = Ok {eo & autoLayout=False}
52 //import System.Socket
53 //import System.Socket.Ipv4
54 ////import System.Select
56 from Data.Map import singleton
57 import Data.Map.GenJSON
61 import iTasks.Extensions.Files
63 //Start w = doTasks (onStartup (copyFile "/home/mrl/test.txt" "/home/mrl/test2.txt")) w
64 //Start w = doTasks (onStartup (workAs SystemUser (return 42))) w
67 t = viewInformation () [] ()
68 >>* [OnAction ActionOk (always (return ()))
69 ,OnAction ActionQuit (always (return ()))
72 //Start w = doTasks t w
74 //t :: Task [(Int, TaskValue Int)]
77 // appendTask Embedded (\_->viewInformation "Int" [] 42) stl
78 // >>! \i->set (singleton "focus" "true") (sdsFocus i (taskListEntryMeta stl))
79 // >>~ \_->viewSharedInformation "Parallel task list" []
80 // (sdsFocus {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=True,includeProgress=True,includeAttributes=True} stl)
91 //Start :: *World -> (MaybeOSError String, *World)
93 // = case socket SocketStream w of
94 // (Error e, w) = (Error e, w)
96 // #! (merr, sockfd) = connect {ipv4_socket_port=8124,ipv4_socket_addr=Just (fromString "127.0.0.1")} sockfd
97 // | isError merr = (liftError merr, w)
98 // #! (merr, sockfd) = recv 128 [] sockfd
99 // | isError merr = (merr, w)
101 // # (merr, w) = close sockfd w
102 // | isError merr = (liftError merr, w)