Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / function.sml
1 (* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 *)
7
8 structure Function: FUNCTION =
9 struct
10
11 fun curry f x y = f(x, y)
12
13 fun uncurry f (x, y) = f x y
14
15 fun compose(f, g) x = f(g(x))
16
17 fun seq(f, g) x = g(f(x))
18
19 fun seq3(f, g, h) x = h(g(f(x)))
20
21 fun layout _ = Layout.str "<function>"
22
23 fun output(_, out) = Out.output(out, "<function>")
24
25 end