State of DData
simonmar at microsoft.com
Fri Mar 26 13:34:18 EST 2004
> > > In my opinion, even "advanced users" should adhere to The
> > > Haskell Report which says that (==) means equality.
> > Where does the report say that? As far as I can see, the
> closest quote is
> > this:
> > The Eq class provides equality (==) and inequality (/=) methods.
> > (section 6.3.1). The report doesn't explicitly say
> anywhere that any
> > assumptions about the properties of == are ever made.
> If the Report calles (==) an equality method then (==) should
> implement equality for every Eq instance.
Arguably then, anything which is an instance of Monad should be a monad.
And '+' should be addition. etc. etc.
Haskell doesn't require any of these to be true, and similarly it
doesn't require that every instance of '==' is equality.
More information about the Libraries