
Am Freitag, 26. März 2004 16:37 schrieb Simon Marlow:
[...]
I'm afraid it isn't true that all instances of Monad respect the monad laws, due to our old friend seq. See:
http://www.haskell.org/pipermail/haskell/2002-May/009622.html
By the way, is there some effort in restricting seq in order to resolve this problem?
I don't want this discussion to get out of hand.
Me, too. ;-)
The only point I'm making here is that the Haskell definition doesn't *require* that every instance of (==) be equality, in the same way that it doesn't *require* that all Monad instances are monads, and all '+'s are additions etc.
Hmm, than we have a different interpretation of the standard as far as (==) is concerned. Well, concerning Monad you're probably right because the Report only says "should" satisfy instead of "shall" satisfy or whatever. As far as I could see the Report says nothing about the meaning of (+).
Libraries might rely on properties of these methods, but as far as is practical those assumptions should be documented.
The problem is that probably a lot of libraries make assumptions like adherance to the Monad laws so that it's maybe difficult to document all these assumptions.
Cheers, Simon
Sorry, if I was a bit dissentious. Wolfgang