caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Patrick M Doane <patrick@watson.org>
To: Didier Le Botlan <lebotlan@beaune.inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Unbound type variables
Date: Thu, 13 Sep 2001 13:40:42 -0400 (EDT)	[thread overview]
Message-ID: <Pine.BSF.3.96.1010913133902.1440E-100000@fledge.watson.org> (raw)
In-Reply-To: <3BA0F11F.DE0303F1@beaune.inria.fr>

Interesting - thanks to you and Olivier for pointing this out!

I wasn't aware of how to do this or what the 'constraint' aspect might be
used for.

Patrick

On Thu, 13 Sep 2001, Didier Le Botlan wrote:

> What do you think of a parameterized class ?
> 
> class ['a] c = object
>   method m (x:'a) =
>     match x with
>       | `A -> ()
>       | `B -> ()
>       | `C -> ()
> end
> 
> class [[< `A | `B | `C] as 'b] c :
>   object constraint 'b = 'b method m : 'b -> unit end    
> 
> Beware that the 'a parameter is freezed for each instance of the class,
> that is you cannot call method m twice on the same object with
> incompatible arguments.
> 
> 
> --
> Didier Le Botlan
> http://cristal.inria.fr/~lebotlan
> 

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


      reply	other threads:[~2001-09-13 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-13 17:15 Patrick M Doane
2001-09-13 17:36 ` Olivier Andrieu
2001-09-13 17:47 ` Didier Le Botlan
2001-09-13 17:40   ` Patrick M Doane [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=Pine.BSF.3.96.1010913133902.1440E-100000@fledge.watson.org \
    --to=patrick@watson.org \
    --cc=caml-list@inria.fr \
    --cc=lebotlan@beaune.inria.fr \
    /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).