On Thu, Feb 7, 2013 at 3:21 PM, Christophe Papazian <christophe.papazian@gmail.com> wrote:
Hi

I'm not sure to understand the difference between :

let f (type s) : s t -> s = ...
let f : type s . s t -> s = ...

except it seems I can use the second one in place of the first one, but sometimes I can't use the first one and need the second one.
So I feel I only need the second one.

As explained in the manual, they are not strictly equivalent.

http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual021.html#toc80

In particular the second syntax guarantees that the type is polymorphic, and syntactically it can only used just after the defined identifier.

This said, in practice the second one mostly subsumes the first one (but it is just syntactic sugar).

Jacques Garrigue