> > class Many m where
> > components :: m a -> [a]
>
> > instance (Many m, Show a) => Show (m a) where
> > showsPrec _ ma = shows (components ma)
>
> I know that an instance declaration requires a type constructor
> (and m is a type constructor variable), but I don't understand why.
> The construction looks good to me.
Haskell syntactically requires that instance declarations have the
form
instance Ctx => C (T a1 ... an) where n>=0
The reason for this restriction is that it is then easy to
guarantee the there are no overlapping instances.
Overlapping instances are bad since they lead to ambiguities
on the overloading resolution.
In your case, imagine that you declare lists to be an
instance of Many (seems pretty reasonable). There would
now be two conflicting instance declarations on how to Show
a list.
-- Lennart