on another note (but staying very much on the same topic), why won't the following generalize: # let foo = let counter = ref 0 in let bar = !counter in let baz = fun x -> bar in baz val foo : '_a -> int = baz clearly has a polymorphic type, yet foo doesn't. Is there any way around this ? --Jacques L. On Fri, Jan 1, 2010 at 6:05 PM, Jacques Le Normand wrote: > Hello caml-list, > with respect to the value restriction, what exactly constitutes a value? > the textbook definition doesn't seem to hold, since the following > generalizes: > > let f = let x = 1 in fun g h x -> g (h x);; > > while this won't: > > let f () = let x = (fun x -> x) (fun x -> x) in fun g h x -> g (h x);; > > cheers > > --Jacques L. >