From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA07801; Wed, 10 Sep 2003 12:40:26 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA07758 for ; Wed, 10 Sep 2003 12:40:25 +0200 (MET DST) Received: from mail3.tpgi.com.au (mail.tpgi.com.au [203.12.160.59]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h8AAeMf21281 for ; Wed, 10 Sep 2003 12:40:23 +0200 (MET DST) Received: from 203-213-85-210-syd-ts17-2600.tpgi.com.au (203-213-85-210-syd-ts17-2600.tpgi.com.au [203.213.85.210]) by mail3.tpgi.com.au (8.11.6/8.11.6) with ESMTP id h8AAe7Z22919; Wed, 10 Sep 2003 20:40:08 +1000 Subject: RE: [Caml-list] strange behaviour with variants and "cannot be g eneralized" From: skaller Reply-To: skaller@ozemail.com.au To: Jacques Garrigue Cc: BeckW@t-systems.com, caml-list@inria.fr In-Reply-To: <20030910171830O.garrigue@kurims.kyoto-u.ac.jp> References: <20030910171830O.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain Message-Id: <1063190367.2119.149.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 10 Sep 2003 20:39:28 +1000 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ozemail:01 jacques:01 t-systems:01 subtyping:01 variance:01 mutable:01 variants:01 variants:01 int:01 garrigue:01 behaviour:01 polymorphic:01 polymorphic:01 match:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 2003-09-10 at 18:18, Jacques Garrigue wrote: > From: "Beck01, Wolfgang" > 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