[Haskell-cafe] Sum and Product do not respect the Monoid laws
Jason Choy
jjwchoy at gmail.com
Fri Sep 26 13:28:35 UTC 2014
>
> subject to certain caveats. It's not unfair to say that
> floating point multiplication is (nearly) associative
> "within a few ulp".
>
I'm not disputing this.
However, you can't deny that this monoid law is broken for the floating
point operations:
mappend x (mappend y z) = mappend (mappend x y) z
Perhaps I'm being pedantic, but this law should hold for all x, y, z, and
it clearly doesn't.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140926/3a33708c/attachment.html>
More information about the Haskell-Cafe
mailing list