[Haskell-cafe] tuples and Show in GHC

Stijn De Saeger stijndesaeger at gmail.com
Sun Mar 6 04:40:09 EST 2005

hi all,

Is there a principled reason why in GHC tuples with up to five
elements automatically derive from the Show class but from six
elements and up they don't anymore? If this is not a bug I would be
very curious to hear what the reasoning behind this is....
below is an example of said behaviour : 

> type MyInt1 = (Int,Int,Int,Int,Int)
> myInt1 :: MyInt1
> myInt1 = (1,2,3,4,5)
> type MyInt2 = (Int,Int,Int,Int,Int,Int)
> myInt2 :: MyInt2
> myInt2 = (1,2,3,4,5,6)


*HS> myInt1
Loading package haskell98 ... linking ... done.
*HS> myInt2

    No instance for (Show MyInt2)
      arising from use of `print' at <interactive>:1
    In a 'do' expression: print it


More information about the Haskell-Cafe mailing list