[mercury-users] semidet vs unique updating

Ralph Becket rafe at cs.mu.OZ.AU
Wed Oct 17 15:29:13 AEST 2001


Michael Day, Wednesday, 17 October 2001:
> 
> > If this is a crucial performance problem for your application, you
> > could implement something using impure code and give it a pure
> > interface.
> 
> Which pure interface? That's really my question. It doesn't seem possible
> to do conditional, semidet updates to a unique structure even though you
> can guarantee that the structure will not be modified if the predicate
> fails.

In general it won't be possible to decide the question of whether a
unique structure will be updated before failure or not.

My though was that you could fake out ui modes using an impure
implementation in this case, although I haven't considered it very
hard and, upon reflection, it's probably a bad idea.

A better solution would be to simply return an extra boolean result
indicating success or failure.

- Ralph
--------------------------------------------------------------------------
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