Original-Via: uk.ac.nsf; Sun, 10 Nov 91 07:55:42 GMT
Paul Hudak writes:
I don't understand your example.
That's because it's *wrong*! I was obviously thinking of Haskell 2,
where the relaxation of the C-T rule allows me to put instance
declarations somewhere besides the defining modules of the class or
type :-). Apologies to all.
I'll still stick with my opinion on this one, though. Here's more
reasons:
a) This represents a potentially large number of new instances which
may be implicitly inserted into the program.
b) I feel it's more likely that a missing superclass would be the
result of a programmer error than an intent to omit the superclass.
c) We have made a stylistic commitment to explicitly listing the
classes generated by a `deriving' clause; why should this
situation be different?
In general, I feel that correct use of the class hierarchy runs
counter to this proposal. A class will generally refer to operations
in its superclasses and empty instance declarations are not likely to
contain meaningful methods.
By the way, the only decent counter argument I have seen to this is as
follows: if a new superclass is added to a class, prior instance
declarations need not be altered to include the new superclass. In
the same manner, if a new method is added to a class, existing
instance declarations need not be altered to include the new method.
Any other opinions??
John