[mercury-users] !foo

Peter Schachte schachte at cs.mu.OZ.AU
Mon Mar 24 12:20:24 AEDT 2003


On Mon, Mar 24, 2003 at 11:27:53AM +1100, Ralph Becket wrote:
> My feeling is that state variable syntax should be recognised as just a
> convenient shorthand and we should not try to pretend it has any direct
> declarative reading.  That is, we should leave it out of the pred and
> mode declarations.

That seems undesirable to me.

Firstly, it's just confusing to have predicate declarations not appear
to match their definitions.  This always bothered me with DCGs, too.

More importantly, failing to support state variables in declarations
fails to support the mental model I believe people want.  This is a
psychological argument, but I believe people really want to think of
some computations as modifying a value in some way, rather than as
computing a new thing related to the old thing in some way.  For
example, do you think of parts of the Mercury compiler as processing
an HLDS to fill in data, or as computing a new HLDS from an old one by
adding more information?  When it comes to io states the argument is
even more compelling, since the mental model of what is going on is
actually the truth; passing the "state of the world" around is a
fiction introduced to maintain purity.

This preferred mental model, I believe, is why the Haskell do notation
makes monads easier:  it allows a more natural mental model of what is
going on.  I believe Mercury should support and encourage simpler,
more natural mental models when it can, even if the implementation
works another way.

-- 
Peter Schachte              As long as we are trying to use our strength
schachte at cs.mu.OZ.AU        rather than our wits, we will lose.
www.cs.mu.oz.au/~schachte/      -- Georges Saab 
Phone: +61 3 8344 9166      
--------------------------------------------------------------------------
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