[Haskell-cafe] A problem with Show

zdenes at seznam.cz zdenes at seznam.cz
Sun Aug 6 04:20:58 EDT 2006


I made a simple datatype called Pair and I'd like to make it an instance of Show class. But when I try to do that I run into troubles:

data Pair a b = Pair a b
instance Show a b => Show (Pair a b) where show (Pair a b) = show a ++ "_" ++ show b

In Hugs I get this error: "Haskell does not support multiple parameter classes" When I run it in ghci I get a kind error "Show is applied to too many type arguments in the instance declaration for Show (Pair a b)"

Am I jsut using wrong syntax or is it not possible to do?

Thanks in advance


More information about the Haskell-Cafe mailing list