maybe a bug in hugs version February 2001

paul.stoeber@in.stud.tu-ilmenau.de paul.stoeber@in.stud.tu-ilmenau.de
Fri, 20 Apr 2001 19:25:35 +0200 (MDT)


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)