From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9D0BBBBFB for ; Sun, 19 Jun 2005 20:09:05 +0200 (CEST) Received: from smtp.irisa.fr (smtp.irisa.fr [131.254.254.26]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5JI95dY009224 for ; Sun, 19 Jun 2005 20:09:05 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.irisa.fr (Postfix) with ESMTP id 3771BFAC3; Sun, 19 Jun 2005 20:09:05 +0200 (CEST) Received: from smtp.irisa.fr ([131.254.254.26]) by localhost (meli.irisa.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03873-03; Sun, 19 Jun 2005 20:09:04 +0200 (CEST) Received: from mail.irisa.fr (melo.irisa.fr [131.254.254.28]) by smtp.irisa.fr (Postfix) with ESMTP id 46397FAB9; Sun, 19 Jun 2005 20:09:04 +0200 (CEST) Received: from 62.147.45.218 (SquirrelMail authenticated user padiolea) by mail.irisa.fr with HTTP; Sun, 19 Jun 2005 20:09:04 +0200 (CEST) Message-ID: <49301.62.147.45.218.1119204544.squirrel@mail.irisa.fr> In-Reply-To: <20050619153707.GA7411@localhost> References: <20050619153707.GA7411@localhost> Date: Sun, 19 Jun 2005 20:09:04 +0200 (CEST) Subject: Re: [Caml-list] ]Caml-list] Types From: padiolea@irisa.fr To: "Eric Cooper" Cc: caml-list@yquem.inria.fr User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at irisa.fr X-Miltered: at nez-perce with ID 42B5B4C1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 caml-list:01 irisa:01 mutable:01 mutable:01 beginner's:01 ocaml:01 beginners:01 bug:01 ...:98 ....:98 wrote:01 polymorphic:01 bin:01 caml:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.0.2 X-Spam-Level: > On Sun, Jun 19, 2005 at 06:42:01PM +1200, Jonathan Roewen wrote: >> Is it possible to create a record type that has a member which is a >> polymorphic type? >> >> I tried: type rect = { mutable x1: 'a; ... } but that doesn't work. >> Also, type a = A of 'a doesn't seem to work either. > > type t = { f : 'a . 'a -> 'a list } > > let x = { f = fun x -> [x] } > > let y = { f = fun x -> [x;x] } why not simply type 'a rect = { mutable x1 = 'a; .... } > > -- > Eric Cooper e c c @ c m u . e d u > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >