[mercury-users] Library v2 and Typeclasses'n'Stuff

Peter Schachte schachte at cs.mu.OZ.AU
Sat Nov 6 16:17:23 AEDT 1999


On Sat, Nov 06, 1999 at 03:14:45PM +1100, David Glen JEFFERY wrote:
> I think that last mode should be:
> 	mode [out|out] = in is semidet

Yup.

BTW, another type class with the same functions, but with the mode 

	mode [in|in] = out is det

instead of the above one would also be useful.  This would correspond
to a C++ "output iterator," while the first one would be an "input
iterator."  Two more interesting variations would be unique versions
(with di/uo modes) of each of these.  You could call these
input_stream and output_stream.

> (or probably mode .(out, out) is semidet).

That would be fine, but I don't see what's wrong with the fancy syntax.

> It would be nice to be able to include some kind of mutual exclusion 
> declaration between `[]/0' and `./2'.

Yes, in this case I think that's pretty important.  Otherwise you'll
have a hard time making the compiler recognize naturally deterministic
predicates and functions as deterministic.  In fact, I'd expect this
will come up a lot with constructor classes.

-- 
Peter Schachte                     Remember, "Euphemisms are for the
mailto:schachte at cs.mu.OZ.AU        differently brained."
http://www.cs.mu.oz.au/~schachte/  -- jamie at cdevil.unx.sas.com (James
PGP: finger schachte at 128.250.37.3  Cooper) 
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list