[Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop
KC
kc1956 at gmail.com
Sun Jul 24 20:19:13 CEST 2011
I like the following but again "+" denotes addition and not a general
binary operation.
> I personally often define the alias:
>
> (<+>) = mappend
A lot of math books use "+" or "x" enclosed in a circle to indicate
that the usual meaning of "+" nor "x" is intended for the meaning of
the binary operation.
I can't figure out if this would compile, the inside "()" representing a circle.
((+)) = mappend
It would be easier for beginners to "grok".
>I don't think so... but while we're at it, what's with that weird name
>"Monoid" anyway, let alone "Functor", "Monad", etc.? ;-)
Ivan: I had thought those were words expressing valid mathematical concepts.
In order to find similarities between apparently different operations
& data one wants to reason abstractly; similar to mathematics.
--
--
Regards,
KC
More information about the Haskell-Cafe
mailing list