[Haskell-beginners] [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

Julian Porter julian.porter at porternet.org
Sun Jul 24 20:29:16 CEST 2011



On 24 Jul 2011, at 19:19, KC wrote:

> 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.

Er no.  Both symbols have extremely precise meanings.  $\oplus$ is the direct sum of two modules and $\otimes$ is their tensor product.

Personally, I wish, given that an additive monad is a kind of monoid, that the names for the zero and addition operations for the two classes were the same.  That said, I am not especially happy with mzero and madd, given that their implication, that the monoid is abelian, is generally false.  

> 
> 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
> 
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110724/db7d22c6/attachment.htm>


More information about the Beginners mailing list