For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

It would be easier for beginners to "grok". -- -- Regards, KC

On 24 July 2011 04:41, KC
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 Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

On 24.07.2011 08:20, Ivan Lazar Miljenovic wrote:
On 24 July 2011 04:41, KC
wrote: It would be easier for beginners to "grok".
I quite like mempty/mappend; they (f)map onto the [] instance as a mnemonic. Similarly, MonadPlus (as a concept) maps to mzero/mplus quite well (and it's distinguishing the sets of empty/append and zero/plus that helps me remember which goes with what). mid and mbinop seem a bit more arbitrary, and don't 'look' as nice to me (though that's probably just because they're not as familiar as what we already have).

On Sat, Jul 23, 2011 at 1:41 PM, KC
It would be easier for beginners to "grok".
I think that assumes that all beginners have a strong foundation in algebra. Although it does have the advantage that the names are as abstract as the class. Antoine
-- -- Regards, KC
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 24.07.2011 22:20, Antoine Latter wrote:
On Sat, Jul 23, 2011 at 1:41 PM, KC
wrote: It would be easier for beginners to "grok".
I think that assumes that all beginners have a strong foundation in algebra. Although it does have the advantage that the names are as abstract as the class.
As pointed out earlier in this list, the name of the class and the methods are inconsistent. Monoid refers to a general algebraic structure, whereas mempty and mappend refer to certain instances like lists.

As pointed out earlier in this list, the name of the class and the methods are inconsistent. Monoid refers to a general algebraic structure, whereas mempty and mappend refer to certain instances like lists.
Thank you for articulating what I was trying to get at. -- -- Regards, KC

On Mon, Aug 8, 2011 at 1:56 AM, Henning Thielemann < schlepptop@henning-thielemann.de> wrote:
On 24.07.2011 22:20, Antoine Latter wrote:
On Sat, Jul 23, 2011 at 1:41 PM, KC
wrote: It would be easier for beginners to "grok".
I think that assumes that all beginners have a strong foundation in algebra. Although it does have the advantage that the names are as abstract as the class.
As pointed out earlier in this list, the name of the class and the methods are inconsistent. Monoid refers to a general algebraic structure, whereas mempty and mappend refer to certain instances like lists.
I don't know what the intention for the names was, but I read them as "syntactic" empty and append, as in the monoid constructs of algebra. In other words, we construct "words" by "appending" (or "concatenating") elements of a monoid. And we have an "empty" word. This usage is common enough in mathematics. After all, if we use the Monoid class interface for a type, we are explicitly using the monoid operations, and not the type's underlying interpretation for appending words in the type. Why should the generic monoid operator names reflect the underlying usage?
participants (6)
-
Alexander Solla
-
Antoine Latter
-
Arlen Cuss
-
Henning Thielemann
-
Ivan Lazar Miljenovic
-
KC