chore(tests/playground/task_testX): update syntax

This commit is contained in:
Sebastian Ullrich 2019-09-09 16:16:19 +02:00
parent 237e4a4489
commit e5ef6eae1f
4 changed files with 12 additions and 12 deletions

View file

@ -13,8 +13,8 @@ dbgTrace ("f2: " ++ toString x) $ fun _ =>
g x g x
def main (xs : List String) : IO UInt32 := def main (xs : List String) : IO UInt32 :=
let t1 := Task.mk $ (fun _ => f1 xs.head.toNat) in let t1 := Task.mk $ (fun _ => f1 xs.head.toNat);
let t2 := Task.mk $ (fun _ => f2 xs.head.toNat) in let t2 := Task.mk $ (fun _ => f2 xs.head.toNat);
dbgSleep 1000 $ fun _ => dbgSleep 1000 $ fun _ =>
IO.println (toString t1.get ++ " " ++ toString t2.get) *> IO.println (toString t1.get ++ " " ++ toString t2.get) *>
pure 0 pure 0

View file

@ -5,8 +5,8 @@ n.repeat (fun r =>
0 0
def main (xs : List String) : IO UInt32 := def main (xs : List String) : IO UInt32 :=
let ys := (List.replicate xs.head.toNat 1) in let ys := (List.replicate xs.head.toNat 1);
let ts : List (Task Nat) := (List.iota 10).map (fun i => Task.mk $ fun _ => run1 (i+1) xs.head.toNat ys) in let ts : List (Task Nat) := (List.iota 10).map (fun i => Task.mk $ fun _ => run1 (i+1) xs.head.toNat ys);
let ns : List Nat := ts.map Task.get in let ns : List Nat := ts.map Task.get;
IO.println (">> " ++ toString ns) *> IO.println (">> " ++ toString ns) *>
pure 0 pure 0

View file

@ -5,8 +5,8 @@ n.repeat (fun r =>
0 0
def main (xs : List String) : IO UInt32 := def main (xs : List String) : IO UInt32 :=
let ys := (List.replicate xs.head.toNat 1) in let ys := (List.replicate xs.head.toNat 1);
let ts : List (Task Nat) := (List.iota 10).map (fun i => Task.mk $ fun _ => run1 (i+1) xs.head.toNat ys) in let ts : List (Task Nat) := (List.iota 10).map (fun i => Task.mk $ fun _ => run1 (i+1) xs.head.toNat ys);
let ns : List Nat := ts.map Task.get in let ns : List Nat := ts.map Task.get;
IO.println (">> " ++ toString ns) *> IO.println (">> " ++ toString ns) *>
pure 0 pure 0

View file

@ -1,12 +1,12 @@
def run1 (i : Nat) (n : Nat) (xs : List Nat) : Nat := def run1 (i : Nat) (n : Nat) (xs : List Nat) : Nat :=
n.repeat (fun r => n.repeat (fun r =>
let s := (">> [" ++ toString i ++ "] " ++ toString r) in let s := (">> [" ++ toString i ++ "] " ++ toString r);
xs.foldl (fun a b => a + b) (r + s.length)) xs.foldl (fun a b => a + b) (r + s.length))
0 0
def main (xs : List String) : IO UInt32 := def main (xs : List String) : IO UInt32 :=
let ys := (List.replicate xs.head.toNat 1) in let ys := (List.replicate xs.head.toNat 1);
let ts : List (Task Nat) := (List.iota 10).map (fun i => Task.mk $ fun _ => run1 (i+1) xs.head.toNat ys) in let ts : List (Task Nat) := (List.iota 10).map (fun i => Task.mk $ fun _ => run1 (i+1) xs.head.toNat ys);
let ns : List Nat := ts.map Task.get in let ns : List Nat := ts.map Task.get;
IO.println (">> " ++ toString ns) *> IO.println (">> " ++ toString ns) *>
pure 0 pure 0