Version française
Home     About     Download     Resources     Contact us    
Browse thread
OO design
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Geoffrey Alan Washburn <geoffw@c...>
Subject: Re: OO design
Dan Grossman wrote:

> Phantom types are a programming idiom that can often pull off this sort 
> of thing.

	Maybe I'm just not smart enough, but I can't seem to think of a way to 
do this in an effectful language without getting bitten by aliasing.  In 
a purely functional setting, a monadic approach seems plausible, but if 
you can create a "ref" anywhere, as in OCaml, it seems straightforward 
to subvert any uses of phantom types for implementing protocols.  I 
suppose one could look at it from the angle that phantom types make it 
harder for cooperative users to make mistakes, but I can't see how they 
can prevent the need for runtime checks.