caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: padiolea@irisa.fr
To: "Eric Cooper" <ecc@cmu.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] ]Caml-list] Types
Date: Sun, 19 Jun 2005 20:09:04 +0200 (CEST)	[thread overview]
Message-ID: <49301.62.147.45.218.1119204544.squirrel@mail.irisa.fr> (raw)
In-Reply-To: <20050619153707.GA7411@localhost>

> 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
>


      reply	other threads:[~2005-06-19 18:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-19  6:42 Jonathan Roewen
2005-06-19  7:09 ` [Caml-list] " Michael Wohlwend
2005-06-19 15:37 ` Eric Cooper
2005-06-19 18:09   ` padiolea [this message]

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=49301.62.147.45.218.1119204544.squirrel@mail.irisa.fr \
    --to=padiolea@irisa.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=ecc@cmu.edu \
    /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).