Browse thread
Question about polymorphic variants
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Xavier Clerc <xcforum@f...> |
| Subject: | Question about polymorphic variants |
Hello, I have a question concerning polymorphic variants and type inference. Formulating my question from the example of section 4.2 in the ocaml manual (version 3.08), I define a function f: let f = function | `On -> 1 | `Off -> 0 which is inferred as: val f : [< `Off | `On ] -> int Then, I use this function in the following expression : List.map f which is in turn inferred as: _[< `Off | `On ] list -> int list My question is about the meaning of the leading underscore in the inferred type (given that I understand the meaning of the underscore in an expression such as "Stack.create ()" that is inferred as: '_a Stack.t). Regards, Xavier Clerc