Ashley Yakeley <[EMAIL PROTECTED]> wrote
> OK, I understand it a bit better now. This code does not compile:
> --
> class X a
> instance X Bool
> instance (Num a) => X a
> --
> Can someone explain why the two instances overlap, given that Bool is not 
> an instance of Num?
> 
> Would it be possible for Haskell to figure out this sort of thing and not 
> complain about it, or would that lead to nasty problems?

Think what would happen if someone had a module that did define
Bool as an instance of Num and imported the class X.

-- 
J�n Fairbairn                                 [EMAIL PROTECTED]
31 Chalmers Road                                         [EMAIL PROTECTED]
Cambridge CB1 3SZ            +44 1223 570179 (after 14:00 only, please!)



_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to