> 1. The Show class
> ~~~~~~~~~~~~~~~~~~
[...]
> class Show a where
> showsPrec :: Int -> a -> ShowS
> show :: a -> String -- NEW
> showList :: [a] -> ShowS
>
> showsPrec _ x s = show x ++ s
> show x = showsPrec 0 x ""
> showList = ...existing default declaration
This gives one more example of what I always wanted to suggest:
The documentation of a class should clearly state which the minimal
sets of definitions are that one has to give, rather than let the
reader figure this out from the code. Default class definitions are
very convenient, but these recursive ones that look like everything is
already defined are a bit mysterious. I agree one might like to define
one member function, another, or both, but tell them what to do at
least. This change looks very good.
The default for (==) however seems odd to me. Someone could like to
define (==) alone or both (==) and (/=), but it seems strange to me to
only define (/=). Or do you just want to give all expressible
relations?
And while you're still doing non-hurting class definition changes, let
me repeat this: please let succ and pred be Enum class members.
Christian Sievers