packages feed

alms-0.6.0: examples/ex03-poly-blame-error.alms

(* Polymorphic version: A Blameworthy Coercion *)

let ap (f: 'a -o 'b) x = f x

let inc2 y =
  let g = (ap :> ('a -A> 'b) -> 'a -U> 'b)
          ((+) 1) in
    g (g y)   (* g is used twice here *)

in print (inc2 5)