HCoop
/
hcoop
/
debian
/
mlton.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Import Upstream version 20180207
[hcoop/debian/mlton.git]
/
doc
/
examples
/
profiling
/
tak.sml
1
structure
Tak
=
2
struct
3
fun
tak1
(
x
,
y
,
z
) =
4
let
5
fun
tak2
(
x
,
y
,
z
) =
6
if
y
>=
x
7
then
z
8
else
9
tak1
(
tak2
(
x
-
1
,
y
,
z
),
10
tak2
(
y
-
1
,
z
,
x
),
11
tak2
(
z
-
1
,
x
,
y
))
12
in
13
if
y
>=
x
14
then
z
15
else
16
tak1
(
tak2
(
x
-
1
,
y
,
z
),
17
tak2
(
y
-
1
,
z
,
x
),
18
tak2
(
z
-
1
,
x
,
y
))
19
end
20
end
21
22
val rec
f
=
23
fn
0
=> ()
24
| ~
1
=>
print
"this branch is not taken
\n
"
25
| n
=> (
Tak
.
tak1
(
18
,
12
,
6
) ;
f
(
n
-
1
))
26
27
val
_
=
f
5000
28
29
fun
uncalled
() = ()