
8 Apr
2008
8 Apr
'08
5:29 a.m.
2008/4/8, Manuel M T Chakravarty
You need to write the instance as
instance (b ~ TheFoo a, Foo a) => Bar (Either a b) where bar (Left a) = foo' a bar (Right b) = foo' (foo b :: a)
If you do that, the program compile, but res still raise a panic in GHC6.8.2 . Before you sent your solution, I also tried to do class (TheFoo a ~ b) => Foo a b where ... instance (Foo a b) => Bar (Either a b) where ... But it didn't compile, it seems to me both versions should have the same behaviour ? -- Jedaï