From: Francois Pottier <Francois.Pottier@inria.fr>
To: Charles Martin <joelisp@yahoo.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] opaque polymorphism
Date: Mon, 10 Sep 2001 09:02:25 +0200 [thread overview]
Message-ID: <20010910090225.A32394@pauillac.inria.fr> (raw)
In-Reply-To: <20010907183550.30294.qmail@web9207.mail.yahoo.com>; from joelisp@yahoo.com on Fri, Sep 07, 2001 at 11:35:50AM -0700
Hello Charles,
You can write:
foo.ml:
type ('a, 'b, 'c) internal_t = { ... }
type ('a, 'c) t = ('a, <some type>, 'c) internal_t
foo.mli:
type ('a, 'c) t
So ``hiding the polymorphism in 'b'' can be done, but you have to tell
the compiler which internal type should be used instead of 'b, i.e. you
have to choose <some type>. I guess the unit type will do in most
situations.
Hope this helps,
--
François Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/
-------------------
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
next prev parent reply other threads:[~2001-09-10 7:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-07 18:35 Charles Martin
2001-09-10 7:02 ` Francois Pottier [this message]
2001-09-10 23:19 ` Phantom types (very long) (Was Re: [Caml-list] opaque polymorphism) Brian Rogoff
2001-09-11 9:44 ` Andreas Rossberg
2001-09-11 18:38 ` [Caml-list] Re: Phantom types (very long) j h woodyatt
2001-09-11 19:16 ` Brian Rogoff
2001-09-12 9:33 ` Daan Leijen
2001-09-14 8:49 ` Jacques Garrigue
2001-09-14 19:10 ` Brian Rogoff
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=20010910090225.A32394@pauillac.inria.fr \
--to=francois.pottier@inria.fr \
--cc=caml-list@inria.fr \
--cc=joelisp@yahoo.com \
/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