caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@ozemail.com.au>
To: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
Cc: BeckW@t-systems.com, caml-list@inria.fr
Subject: RE: [Caml-list] strange behaviour  with variants and "cannot be g	 eneralized"
Date: 10 Sep 2003 20:39:28 +1000	[thread overview]
Message-ID: <1063190367.2119.149.camel@localhost.localdomain> (raw)
In-Reply-To: <20030910171830O.garrigue@kurims.kyoto-u.ac.jp>

On Wed, 2003-09-10 at 18:18, Jacques Garrigue wrote:
> From: "Beck01, Wolfgang" <BeckW@t-systems.com>

>  In that case we have now polymorphic fields.
>       type mix = {data: 'a. 'a -> 'a ; mutable count: int}
>       let r = {data = (fun x -> x); count = 0}
> 
> So, I think this is a good idea in itself, but before I try again
> introducing this improvement, I need a few compelling examples to
> justify the effort.

Curious: this isn't yet dual to the variants: the field values
are polymorphic, by the record itself is not. Wouldn't one like
to have a record of a set of tags where the typing is like:

	match { `A 1; `B 2 } with
	| { `A x } -> ...

that is, allow subtyping based on tag sets?
[Hmm .. what is the variance of the field values ?]

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-09-10 10:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-10  7:10 Beck01, Wolfgang
2003-09-10  8:12 ` Fernando Alegre
2003-09-10  8:18 ` Jacques Garrigue
2003-09-10 10:39   ` skaller [this message]
2003-09-10  9:48 ` skaller
2003-09-10 11:34   ` Frederic De Jaeger
  -- strict thread matches above, loose matches on Subject: below --
2003-09-09 14:13 Beck01, Wolfgang
2003-09-09 19:17 ` Didier Remy

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=1063190367.2119.149.camel@localhost.localdomain \
    --to=skaller@ozemail.com.au \
    --cc=BeckW@t-systems.com \
    --cc=caml-list@inria.fr \
    --cc=garrigue@kurims.kyoto-u.ac.jp \
    /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).