[Haskell-cafe] Sum and Product do not respect the Monoid laws

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Sat Sep 27 09:13:45 UTC 2014


On Fri, Sep 26, 2014 at 11:38:03PM -0400, Carter Schonwald wrote:
> For anything to be a Monoid (or any type class with laws), you implicitly
> have a definition of equivalence you want your laws to use.  And for many
> classes, those laws are using an equivalence not definable using Eq.  A
> good example Is monad! You can not define Eq instances for arbitrary a-> m
> b.  We can still define and talk about lawful monads.

Definable in Haskell or not, this supposed fuzzy equality for Double won't
be transitive will it?  It sounds like it will just raise another problem.

Tom


More information about the Haskell-Cafe mailing list