[mercury-users] functional dependencies question

Ralph Becket rafe at cs.mu.OZ.AU
Fri Jan 27 10:49:29 AEDT 2006


Mark Brown, Thursday, 19 January 2006:
> On 18-Jan-2006, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> > 
> > I don't think it hurts to require the functional dependencies to be 
> > explicit in subclasses and I think it does make the code clearer.  On 
> > the other hand it is a bit unintuitive, since you're not required to 
> > explicitly list all the other superclass constraints.
> 
> Hmm, good point.

My tuppence on this:

first penny - if you're going to require that FDs be duplicated on
subclass definitions then the error message should clearly reflect the
omission *and* include some kind of justification;

second penny - I think requiring duplication of FD requirements is a bad
idea because of the surprise aspect ("Why is the compiler complaining?
I've already told it T depends on S over here...  Oh, it says I have to
in the Reference Manual.  Why is it necessary?" etc.)

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