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 LAA26690; Tue, 11 Sep 2001 11:44:32 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA26637 for ; Tue, 11 Sep 2001 11:44:31 +0200 (MET DST) Received: from uni-sb.de (uni-sb.de [134.96.252.33]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f8B9iU108461 for ; Tue, 11 Sep 2001 11:44:30 +0200 (MET DST) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.11.6/2001082200) with ESMTP id f8B9iUP08070 for ; Tue, 11 Sep 2001 11:44:30 +0200 (CEST) Received: from mail.cs.uni-sb.de (IDENT:n+rwK5gaMkeSXTk143DJ3hsbIafQVwcP@mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.11.6/2001081600) with ESMTP id f8B9iTd15504 for ; Tue, 11 Sep 2001 11:44:29 +0200 (CEST) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.11.6/2001082200) with ESMTP id f8B9iRo04481 for ; Tue, 11 Sep 2001 11:44:27 +0200 (CEST) X-Authentication-Warning: email: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (zoidberg.ps.uni-sb.de [134.96.186.121]) by ps.uni-sb.de (8.11.2/8.11.0) with ESMTP id f8B9iRt25283; Tue, 11 Sep 2001 11:44:27 +0200 Message-ID: <3B9DDCFB.384A3748@ps.uni-sb.de> Date: Tue, 11 Sep 2001 11:44:27 +0200 From: Andreas Rossberg Organization: =?iso-8859-1?Q?Universit=E4t?= des Saarlandes X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.3-12 i686) X-Accept-Language: de, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: Phantom types (very long) (Was Re: [Caml-list] opaque polymorphism) References: <20010910154559.O6031-100000@shell5.ba.best.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Brian Rogoff wrote: > > The final example is familiar to anyone who reads comp.lang.ml, where I > mistakenly asserted that you couldn't have statically typed array > dimensions in ML like you can in C++ or Ada. Matthias Blume then posted > a solution which works (though it reminds me a bit of that proverb of the > dancing bear). Actually, Matthias gave a very interesting talk on the Babel workshop in Florence last Saturday where he showed how to encode the complete C type system in ML (including functions, pointers, constness, bitfields, and all dark corners - the only bit still missing is varargs), using even more phantom type trickery. Unfortunately, the paper is not yet available online, but as his work is part of the new FFI of SML/NJ you can read about the encoding in its documentation (inside the ml-nlffi-lib.tgz of the latest working version). Cheers, - Andreas -- Andreas Rossberg, rossberg@ps.uni-sb.de "Computer games don't affect kids; I mean if Pac Man affected us as kids, we would all be running around in darkened rooms, munching magic pills, and listening to repetitive electronic music." - Kristian Wilson, Nintendo Inc. ------------------- 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