Re: Eq instance for (a,b,c,d,e) and upwards



About this list Date view Thread view Subject view Author view

Marcin 'Qrczak' Kowalczyk (qrczak@knm.org.pl)
22 Apr 2001 09:41:04 GMT


Fri, 20 Apr 2001 14:49:49 +0200, Martin Norbäck <d95mback@dtek.chalmers.se> pisze: > > This is no particular reason for this restriction. Ghc defines > > standard instances for tuples only up to 5. I suppose nhc98 should > > at least match that. > > Would be nice if this was regulated by the Haskell standard in some way, 6.1.4 Tuples Tuples are algebraic datatypes with special syntax, as defined in Section 3.8. Each tuple type has a single constructor. There is no upper bound on the size of a tuple. However, some Haskell implementations may restrict the size of tuples and limit the instances associated with larger tuples. The Prelude and libraries define tuple functions such as zip for tuples up to a size of 7. All tuples are instances of Eq, Ord, Bounded, Read, and Show. Classes defined in the libraries may also supply instances for tuple types. I don't like that Haskell implementations limit tuple instances so much. I once needed equality on 9-tuples. Supplying own instance is not portable for implementations which do supply enough instances... -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRCZAK


About this list Date view Thread view Subject view Author view