Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / regression / kitdangle3.sml
CommitLineData
7f918cf1
CE
1(*kitdangle3.sml*)
2
3infix - + :: =
4(*fun op = (x: ''a, y: ''a): bool = prim("=", "=", (x, y)) *)
5
6exception Hd
7fun hd (x::l) = x
8 | hd [] = raise Hd
9
10fun mklist 0 = []
11 | mklist n = n :: mklist(n-1)
12
13fun cycle(p as (m,f)) =
14 if m=0 then p
15 else cycle(m-1,
16 let val x = [(m, mklist 2000)]
17 in fn () => #1(hd x) + f()
18 end)
19
20val r = ((cycle(1000, fn() => 0);()),
21 (cycle(1000, fn() => 0);()),
22 (cycle(1000, fn() => 0);()))