(* Typed call-by-value fix *) datatype ('a,'b) F = fold of ('a,'b) F -> 'a -> 'b ; fun unfold (fold x) = x ; val fix = fn f => let val D = fn x => fn y => f ( (unfold x) x ) y in D (fold D) end ;