1 (* Copyright (C
) 1999-2006 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
4 * MLton is released under a BSD
-style license
.
5 * See the file MLton
-LICENSE for details
.
8 structure Function
: FUNCTION
=
11 fun curry f x y
= f(x
, y
)
13 fun uncurry
f (x
, y
) = f x y
15 fun compose(f
, g
) x
= f(g(x
))
17 fun seq(f
, g
) x
= g(f(x
))
19 fun seq3(f
, g
, h
) x
= h(g(f(x
)))
21 fun layout _
= Layout
.str
"<function>"
23 fun output(_
, out
) = Out
.output(out
, "<function>")