alms-0.4.9: examples/ex04-poly.alms
(* Polymorphic version: ex03 corrected *)
let ap : all 'a 'b. ('a -o 'b) -> 'a -o 'b =
fun 'a 'b (f: 'a -o 'b) (x : 'a) -> f x
let inc2 : int -> int =
fun y: int ->
let g = ap[int,int] (fun z: int -> z + 1) in
let h = ap[int,int] (fun z: int -> z + 1) in
h (g y)
in print[int] (inc2 5)