Prelude says:

data Either a b = Left a | Right b
                  deriving (Eq, Ord, Read, Show)
                                           ^^^^

Interactive session:

Prelude> Left 3
ERROR - Cannot find "show" function for:
*** Expression : Left 3
*** Of type    : Either Integer a


Test script:

> data Foo a b = Bar a | Baz b
> showFoo (Bar x) = "Bar: " ++ show x
> showFoo (Baz x) = "Baz: " ++ show x


Interactive session:

Main> showFoo (Bar 3)
ERROR - Unresolved overloading
*** Type       : Show a => [Char]
*** Expression : showFoo (Bar 3)

_______________________________________________
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs

Reply via email to