From: rixed@happyleptic.org
To: caml-list@inria.fr
Subject: Re: [Caml-list] typer strangeness (3.12.0)
Date: Sun, 14 Aug 2011 08:19:59 +0200 [thread overview]
Message-ID: <20110814061959.GC32098@yeeloong.happyleptic.org> (raw)
In-Reply-To: <4E3D3A89.90007@inria.fr>
Thank you for your answers, but you aimed too high above my
understanding :-)
-[ Sat, Aug 06, 2011 at 02:58:49PM +0200, Fabrice Le Fessant ]----
> The type constraint that you specified does not constraint the
> polymorphism of the type. To declare a polymorphic constraint, you must
> use (with OCaml >= 3.12.0) :
>
> let pipe : 'a 'b 'c. ('a, 'b) parzer -> ('c, 'a) parzer -> ('c, 'b) parzer =
Never saw this notation before. I checked in the manual but beside in
the language grammar (in the definition of a poly-typexpr) I could find
more explanation.
Is it explained somewhere why this notation was required and why this:
let pipe : ('a, 'b) parzer -> ('c, 'a) parzer -> ('c, 'b) parzer =
is not enough? What's adding the "'a 'b 'c. " exactly ? I understand
that it forbids ocaml to consider that the various 'a (for instance) may
be differents 'a, but I don't understand why ocaml migh do that in the
first place (especially to produce a _less general_ type than the one
given) ? If it's not a bug, then what's the purpose ?
As for my second question, I received no answer (was: why changing the
pattern match for something that should be equivalent changes the infered
type). If you suspect this can be a bug then I can look for a simple
reproductible case.
next prev parent reply other threads:[~2011-08-14 6:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-06 12:50 rixed
2011-08-06 12:58 ` Fabrice Le Fessant
2011-08-06 17:03 ` Guillaume Yziquel
2011-08-14 6:19 ` rixed [this message]
2011-08-14 7:08 ` Guillaume Yziquel
2011-08-14 7:59 ` rixed
2011-08-14 9:46 ` Jacques Garrigue
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=20110814061959.GC32098@yeeloong.happyleptic.org \
--to=rixed@happyleptic.org \
--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