Function parameter that specifies keyword of type

I saw some code somewhere like this

let foo (type a) = 1 + 1;;

This code have output 2. what the type a means in this function? (I didn’t define the type a when I execute the above code)

Can you give a resource link relevant with this?

Thank you!

1 Like

See https://caml.inria.fr/pub/docs/manual-ocaml/locallyabstract.html

Best wishes,
Nicolás

1 Like