Backport from sid to buster
[hcoop/debian/mlton.git] / regression / kitdangle.sml
CommitLineData
7f918cf1
CE
1(*kitdangle.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, let val x = [(m, mklist 2000)]
16 in fn () => #1(hd x) + f()
17 end)
18
19val r = cycle(1000, fn() => 0);