[m-dev.] dummy types with user-defined equality/comparison

Mark Brown mark at cs.mu.OZ.AU
Mon Jun 5 16:50:48 AEST 2006


On 05-Jun-2006, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> On Mon, Jun 05, 2006 at 04:07:44PM +1000, Mark Brown wrote:
> > On 05-Jun-2006, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> > > I think the problem comes from the fact that dummy types are transparent
> > > when they should be opaque.
> > 
> > "Opaque" is a good word.  How about:
> > 
> > 	:- opaque type foo ---> foo.
> > 
> > as a declaration?
> > 
> 
> Or just:
> 
> :- opaque type foo.
> 
> Since it's a dummy type there's no need to actually define foo (indeed
> it wouldn't be opaque any more if you did :-)

Unless it's io.state, your program will need to create one of these
somewhere.  You'll need the constructor there, unless you write foreign
code to fake it.

Cheers,
Mark.

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list