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

Personally, I have nothing against mempty (although I agree that mid makes
more sense), but I don't like mappend at all. I wonder what happened to the
idea of using <> instead of mappend (that's what I always do). I think
a <> b <> c
looks so much better than
a `mappend` b `mappend` c
and it solves the name problem altogether.
-- Maciej
On Jul 24, 2011 3:42 AM, "KC"

Don't forget that some languages use <> to mean "different" (as if
"different" meant always "superior or inferior"...), so some beginners might
get confused.
I personally often define the alias:
(<+>) = mappend
2011/7/24 Maciej Wos
Personally, I have nothing against mempty (although I agree that mid makes more sense), but I don't like mappend at all. I wonder what happened to the idea of using <> instead of mappend (that's what I always do). I think
a <> b <> c
looks so much better than
a `mappend` b `mappend` c
and it solves the name problem altogether.
-- Maciej On Jul 24, 2011 3:42 AM, "KC"
wrote: _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

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@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Sun, 2011-07-24 at 19:29 +0100, Julian Porter wrote:
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.
Well. Notation depends on branch. I've seen routinely used + as addition in Z_{2,3,...} - for example 2 + 2 = 0. For example λ have different meaning when you would say about exponential distribution/radioactive decay and different when you talk about wavelength. If you are using lambda calculus it have yet another meaning. And according to http://en.wikipedia.org/wiki/Lambda those are just 3 of many meanings. I've seen ⊕ used as binary operation when the other were already used before I learned that it may denote the direct sum. Regards

Yes, this has sort-of been agreed upon in a GHC ticket about a year
ago: http://hackage.haskell.org/trac/ghc/ticket/3339
I had a patch in Darcs, but then came the switch to Git. I ported it
to Git, but didn't iron out all the issues. That was quite a while
ago so it's currently a bit bitrotten. I don't think it's enough time
to get it into 7.2, but since that's largely an unstable release, it
wouldn't hurt until 7.4. I'll probably work on it at CamHac in a few
weeks.
On 24 July 2011 13:14, Maciej Wos
Personally, I have nothing against mempty (although I agree that mid makes more sense), but I don't like mappend at all. I wonder what happened to the idea of using <> instead of mappend (that's what I always do). I think
a <> b <> c
looks so much better than
a `mappend` b `mappend` c
and it solves the name problem altogether.
-- Maciej
On Jul 24, 2011 3:42 AM, "KC"
wrote: _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Push the envelope. Watch it bend.

On Sun, 2011-07-24 at 21:14 +0900, Maciej Wos wrote:
Personally, I have nothing against mempty (although I agree that mid makes more sense), but I don't like mappend at all. I wonder what happened to the idea of using <> instead of mappend (that's what I always do). I think
a <> b <> c
looks so much better than
a `mappend` b `mappend` c
As of a year or two ago, I think it was common knowledge that this was going to happen. I'd love to see it, definitely. (Regarding it being a comparison operator in other languages, there are plenty of places where operators differ in Haskell... among them, /= and
. I don't see this as a serious issue at all. A new language can mean different operators. If there were a *subtle* difference that might be missed, it would be one thing, but this is the sort of thing where if you're confused in that way, nothing will make any sense and you'll ultimately realize that <> must mean something different.)
-- Chris Smith
participants (7)
-
Chris Smith
-
Julian Porter
-
KC
-
Maciej Marcin Piechotka
-
Maciej Wos
-
Thomas Schilling
-
Yves Parès