[Haskell-cafe] tuples and Show in GHC

Daniel Fischer daniel.is.fischer at web.de
Sun Mar 6 11:37:56 EST 2005


Am Sonntag, 6. März 2005 10:40 schrieb Stijn De Saeger:
> 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....
>
The Show instances for tuples aren't automatically derived, they are defined 
in GHC.Show. So somewhere there must be an end, probably the author(s) 
thought that larger tuples than quintuples aren't used often enough to 
bother. That's not a principled reason but a practical one, but it's good 
enough for me.
If you need them frequently and don't want to define your own instances, 
complain.
BTW, tuples are defined in Data.Tuple up to 62-tuples and Eq and Ord instances 
are derived up to 15-tuples.
In Hugs, apparently they are only provided up to quintuples.

Hope, this isn't too disappointing,
Daniel


More information about the Haskell-Cafe mailing list