Simon, thanks for the explanation, that makes a bit more sense now.
So the situation is that a relaxation of this rule is possible,
it's just a matter of whether this would ever be any use to anyone,
and indeed worth the extra pain of all those (additional) Overlapping
Instance!, and Ambiguity! errors...

> In the multi-paramter case things are less clear:
> 
>       class C a b where
>          op :: a -> a
> 
> Here, op :: C a b => a -> a.  So suppose we use op on an Int argument.
> Then we need to find an instance for (C Int b).  If there is an 
> instance
> 
>       instance C Int b where
>          ...
> 
> (and of course no overlapping instances) then we are home.
> Is that your stituation here?

More or less.  The class I was trying to define is buggy anyway, so
isn't really a good example.  (Effectively I was trying to re-do
"Collection" with the collection _type_, rather than type constructor,
as the first type parameter, which I don't think makes much sense, as
it leads to an underconstrained situation between the two parameters.)

Slainte,
Alex.

Reply via email to