[mercury-users] query

Michael Day mikeday at yeslogic.com
Tue Mar 18 18:48:15 AEDT 2003


> The advantage of using module qualifiers is that it (IMHO) makes it
> easier for readers of the code.

How about we reconcile these two viewpoints by appending "in many
circumstances" or some other disclaimer?

For example, I maintain that the first of these examples wins:

:- pred main(io, io).
:- pred main(io__io, io__io).
:- pred main(io__state, io__state).

And also that qualifying foldl or an equivalently generic predicate is
unnecessary, as the intention of the code is to treat the argument as a
sequence of some kind without specifying its type. If in the future foldl
migrates to a type class method in a generic sequence module,
qualification will become irrelevant anyway.

But as you say, there are cases where module qualification could increase
readability. A rarely used predicate may benefit from module qualification 
to clarify its origin, and types or predicates with very generic names 
that depend heavily on context could also benefit - (this is different 
from the foldl example above, where although the name is generic it does 
not significantly depend on context).

Michael

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