RosettaCodeData/Task/Higher-order-functions/ATS/higher-order-functions.ats

14 lines
239 B
Plaintext

#include
"share/atspre_staload.hats"
fun app_to_0 (f: (int) -> int): int = f (0)
implement
main0 () =
{
//
val () = assertloc (app_to_0(lam(x) => x+1) = 1)
val () = assertloc (app_to_0(lam(x) => 10*(x+1)) = 10)
//
} (* end of [main0] *)