Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2004-07-31 (17:45)
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 -

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: