From: skaller <skaller@users.sourceforge.net>
To: Christophe TROESTLER <debian00@tiscali.be>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] What is an open type?
Date: 26 Nov 2004 10:58:24 +1100 [thread overview]
Message-ID: <1101427104.9291.94.camel@pelican.wigram> (raw)
In-Reply-To: <20041125.191933.88348027.debian00@tiscali.be>
On Fri, 2004-11-26 at 05:19, Christophe TROESTLER wrote:
> On 26 Nov 2004, skaller <skaller@users.sourceforge.net> wrote:
> >
> > An open type like [> `X ] isn't actually a type, you can't
> > name it like:
> >
> > type xx = [> `X ]
>
> It is polymorphic:
>
> type 'a xx = 'a constraint 'a = [> `X];;
Wow! I didn't realise you could do that.
This solves a heap of problems for me. Thanks!
This looks (visualy) like
'a constraint >= [ `X ]
i.e. a sneaky way of getting subtyping :)
Pity this doesn't work:
# type pm = 'b constraint 'b = [> ];;
A type variable is unbound in this type declaration
--
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850,
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net
prev parent reply other threads:[~2004-11-25 23:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-25 15:57 skaller
2004-11-25 18:19 ` [Caml-list] " Christophe TROESTLER
2004-11-25 23:58 ` skaller [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=1101427104.9291.94.camel@pelican.wigram \
--to=skaller@users.sourceforge.net \
--cc=caml-list@inria.fr \
--cc=debian00@tiscali.be \
/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