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