Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] const equivalent for mutable types?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Gorski <cgorski@c...>
Subject: Re: [Caml-list] const equivalent for mutable types?
Markus Mottl wrote:

> No, you'd need an abstract module for this to hide the concrete
> representation.  This is actually good SE-practice.
> 
> You can do this very conveniently using so-called phantom types.  For the
> special case of references, here is an example that implements ones,
> which can be made constant:

Everyone's responses were helpful, and this is exactly what I was 
looking for.  Thank you.

-- 
Chris Gorski - http://www.cgorski.org

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners