From: Xavier Clerc <xcforum@free.fr>
To: caml-list@inria.fr
Subject: Question about polymorphic variants
Date: Fri, 28 Oct 2005 11:57:26 +0200 [thread overview]
Message-ID: <589B1E9E-D4EC-4E03-9375-30670ED82BEB@free.fr> (raw)
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
next reply other threads:[~2005-10-28 9:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-28 9:57 Xavier Clerc [this message]
2005-10-28 11:59 ` [Caml-list] " Jacques Garrigue
2005-10-28 12:27 ` Xavier Clerc
2005-10-29 0:26 ` Jacques Garrigue
2005-10-31 17:08 ` Xavier Clerc
2005-11-01 0:27 ` Jacques Garrigue
2005-11-04 13:20 ` Xavier Clerc
2005-11-07 3:11 ` Jacques Garrigue
2005-11-07 13:39 ` Xavier Clerc
2008-05-02 17:35 question " Jacques Le Normand
2008-05-02 18:03 ` Rémi Vanicat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=589B1E9E-D4EC-4E03-9375-30670ED82BEB@free.fr \
--to=xcforum@free.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox