On 04-Nov-1998, Erik Meijer <[EMAIL PROTECTED]> wrote:
> Let me try to sketch a design methodology for introducing type classes
[...]
> It is good style to define non-overloaded versions of class methods outside
> of the class instead of inlining them in the instance declaration. For
> example the usual instance declaration Eq a => Eq [a] is utterly confusion.
> Instead first define eqList :: Eq a => [a] -> [a] -> Bool and then simple
> say instance Eq a => Eq [a] where { (==) = eqList }.

I'm not sure I'd agree with this.  Defining all of those non-overloaded
versions of class methods requires inventing a lot of names;
I find the resulting namespace polution can be a bit ugly.

> It is bad style to have trivial definitions for class methods, in which case
> you are lying to the user.

I don't know what you mean here.  Could you explain this in more detail?

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.


Reply via email to