From: "Daan Leijen" <daan@cs.uu.nl>
To: <jhw@wetware.com>, "The Caml Trade" <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: Phantom types (very long)
Date: Wed, 12 Sep 2001 11:33:04 +0200 [thread overview]
Message-ID: <00a401c13b6d$ec478a30$9650d383@ajam> (raw)
In-Reply-To: <25775F60-A6E4-11D5-9E93-000502DB38F5@mac.com>
On Tue, 11 Sep 2001, j h woodyatt wrote:
> This "phantom types" design pattern is one I have never seen before. It
> doesn't seem to be used in the standard library anywhere I can see. It
> looks like it might be useful in presenting a safer network programming
> interface than the low-level wrappers around BSD sockets (which I've
> never liked).
We used phantom types extensively for exactly this purpose -- a typed
wrapper around a low-level interface. It seems that the trick has been in
use
already in the 80's for ML libraries that accessed sockets (allthough it
didn't
had a sexy name in that time). We tried to describe the general use pattern
in detail in the paper "domain specific embedded compilers" which can be
found at:
http://www.cs.uu.nl/~daan/pubs.html
We also used phantom types to encode single type inheritance for the
H/direct frame work (described in "calling hell from heaven and heaven from
hell")
All the best,
Daan Leijen.
-------------------
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-12 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-07 18:35 [Caml-list] opaque polymorphism Charles Martin
2001-09-10 7:02 ` Francois Pottier
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 [this message]
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='00a401c13b6d$ec478a30$9650d383@ajam' \
--to=daan@cs.uu.nl \
--cc=caml-list@inria.fr \
--cc=jhw@wetware.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;
as well as URLs for NNTP newsgroup(s).