Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] simple typing question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-07-02 (08:49)
From: Michael Vanier <mvanier@c...>
Subject: [Caml-list] simple typing question

I imagine this has been asked and answered before, so I apologize in

Compare these two functions:

# let f x = (fun y -> y) x ;;
val f : 'a list -> 'a list = <fun>


# let f = (fun y -> y) ;;
val f : '_a list -> '_a list = <fun>

Why does the second use the '_a type variable instead of 'a?  I thought
that special type variables only had to do with polymorphic references.
The FAQ states that the latter expression can't be generalized, but I don't
really understand why.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: