Hi all

With overlapping instances, I'm allowed

  class OK x y

  instance Functor f => OK (f x) (f y)

  instance Functor f => OK x (f y)

but I'm not allowed

  class Bad x y z | x y -> z

  instance Functor f => Bad (f x) (f y) Bool

  instance Functor f => Bad x (f y) Int

I don't quite see why. Naively, I imagine that if the OK instances are
effectively prioritized, then Bad's rules for computing z from x and y
could be similarly prioritized. Can anyone explain why this naive
imagining is incorrect?

Cheers

Conor

PS a more complicated, less contrived example is available on request
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to