On Oct 24, 2010, at 8:52 AM, wren ng thornton wrote:
But then, how should we decide whether the additive or
multiplicative structure is more "neutral"?
On Oct 24, 2010, at 7:08 AM, Jacques Carette wrote:
People usually use additive notation for commutative monoids, and
multiplicative notation for generic monoids. It's a convention,
nothing else.
I recently used
class Monoid m where
one :: m
(*) :: m -> m -> m
class CommutativeMonoid m where
zero :: m
(+) :: m -> m -> m
class (Monoid s, CommutativeMonoid s) => Semiring s
(The `Semiring` class only serves as a contract for additional laws.)
Considering the convention Jaques mentions and my wish for splitting
the two monoids underlying a semiring into separate classes, it seemed
natural to use multiplicative notation for the "neutral" case.
Sebastian
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe