From: "Lukasz Stafiniak" <lukstafi@gmail.com>
To: ocaml_beginners@yahoogroups.com, "caml users" <caml-list@inria.fr>
Subject: Re: "ocaml_beginners"::[] Syntax for polymorphic methods
Date: Mon, 26 Feb 2007 20:02:08 +0100 [thread overview]
Message-ID: <4a708d20702261102x38ac9fd6v5cdefa9c436de9eb@mail.gmail.com> (raw)
In-Reply-To: <301730110702260959i561902dar1a26dceb5a11fd2c@mail.gmail.com>
On 2/26/07, Geoffrey Romer <geoff.romer@gmail.com> wrote:
>
> So what's the difference between 'a. <stuff> and just plain <stuff>? Aren't
> type variables implicitly universally quantified (i.e. isn't the whole point
> of a polymorphic type that it applies for any possible 'a)?
>
You've got me here...
Objective Caml version 3.09.3
# type pty = {pv : 'a . 'a list};;
type pty = { pv : 'a. 'a list; }
# let px = {pv = []};;
val px : pty = {pv = []}
# match px with
{pv=[]} -> "OK"
| {pv=5::_} -> "int"
| {pv=true::_} -> "bool";;
Fatal error: exception Assert_failure("typing/parmatch.ml", 784, 55)
Process caml-toplevel exited abnormally with code 2
next parent reply other threads:[~2007-02-26 19:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <301730110702251711h258dd326nb8a38f6751c4c8ea@mail.gmail.com>
[not found] ` <4a708d20702260334i47bbde3fgcdf2ca2c296338c8@mail.gmail.com>
[not found] ` <301730110702260959i561902dar1a26dceb5a11fd2c@mail.gmail.com>
2007-02-26 19:02 ` Lukasz Stafiniak [this message]
2007-02-27 4:37 ` [Caml-list] " 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=4a708d20702261102x38ac9fd6v5cdefa9c436de9eb@mail.gmail.com \
--to=lukstafi@gmail.com \
--cc=caml-list@inria.fr \
--cc=ocaml_beginners@yahoogroups.com \
/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;
as well as URLs for NNTP newsgroup(s).