Import Upstream version 20180207
[hcoop/debian/mlton.git] / benchmark / tests / flat-array.sml
CommitLineData
7f918cf1
CE
1structure Main =
2 struct
3 fun doit n =
4 let
5 val v = Vector.tabulate (1000000, fn i => (i, i + 1))
6 fun loop n =
7 if 0 = n
8 then ()
9 else
10 let
11 val sum = Vector.foldl (fn ((a, b), c) =>
12 a + b + c handle Overflow => 0) 0 v
13 in
14 loop (n - 1)
15 end
16 in
17 loop n
18 end
19 end
20