Browse thread
[Caml-list] opaque polymorphism
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2001-09-11 (09:44) |
From: | Andreas Rossberg <rossberg@p...> |
Subject: | Re: Phantom types (very long) (Was Re: [Caml-list] opaque polymorphism) |
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