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

Chris Smith cdsmith at gmail.com
Sun Jul 24 21:29:57 CEST 2011


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




More information about the Haskell-Cafe mailing list