From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA13306; Wed, 12 Sep 2001 11:32:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA13556 for ; Wed, 12 Sep 2001 11:32:30 +0200 (MET DST) Received: from mail.cs.uu.nl (sunset.cs.uu.nl [131.211.80.32]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8C9WTD02475 for ; Wed, 12 Sep 2001 11:32:29 +0200 (MET DST) Received: from ajam (ajam.cs.uu.nl [131.211.80.150]) by mail.cs.uu.nl (Postfix) with SMTP id 18A7C4548; Wed, 12 Sep 2001 11:32:29 +0200 (MET DST) Message-ID: <00a401c13b6d$ec478a30$9650d383@ajam> From: "Daan Leijen" To: , "The Caml Trade" References: <25775F60-A6E4-11D5-9E93-000502DB38F5@mac.com> Subject: Re: [Caml-list] Re: Phantom types (very long) Date: Wed, 12 Sep 2001 11:33:04 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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