Eq instance for (a,b,c,d,e) and upwards
Mon, 23 Apr 2001 14:22:45 +0200 (MET DST)
Olaf Chitil writes:
> I think that this discussion about tuples shows that there is a problem
> with the Haskell 98 report which should be corrected. I hope Simon
> accepts it as a minor bug fix.
> 1) The current wording of paragraph 6.1.4 is highly ambigious.
> > 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.
This may be nitpicking, but I would rephrase this last sentence to
"Tuples whose all component types are instances of Eq, Ord, Bounded,
Read, or Show are themselves instances of Eq, Ord, Bounded, Read, or
(Eg. (a->a, b) is not an instance of Eq.)
[email protected] Masaryk University, Faculty of Informatics
tel +420-5-41512355 Botanicka 68a, Brno, CZ-60200
pgp fingerprint 32 0A AB E1 62 D6 BF 86 82 09 AA 47 2B F4 45 98