12 lines
249 B
Text
12 lines
249 B
Text
|
fun compose (f, g) =
|
||
|
\(x) => f (g (x))
|
||
|
|
||
|
fun id (x) = x
|
||
|
|
||
|
fun twice (x) = 2 * x
|
||
|
|
||
|
val main =
|
||
|
print_int (twice (21));
|
||
|
print_int (compose (id, twice) (21));
|
||
|
print_int (compose (twice, id) (21));
|
||
|
print_int (compose (twice, twice) (10))
|