This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
compilation/flap/tests/04-Hobix_to_Fopix/06-compose.hobix

12 lines
249 B
Text
Raw Normal View History

2023-12-11 11:49:02 +01:00
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))