[Haskell-cafe] Generalizing (++) for monoids instead of using (<>)
Alberto G. Corona
agocorona at gmail.com
Fri May 4 11:02:49 CEST 2012
Thinking aloud, I dónt know if the transition to more abstract type
signatures can be aleviated using language directives.
Restrict (++) String -> String -> String
that locally would restrict the type within the module.
Althoug it does not avoid breaking the old code, It permits an easy fix.
Moreover, This may have applications in other contexts, for example
teaching, because the wild abstraction of the error messages is the
most difficult barrier in haskell learning.
2012/4/1 Thomas DuBuisson <thomas.dubuisson at gmail.com>:
> On Sun, Apr 1, 2012 at 1:58 PM, aditya bhargava
> <bluemangroupie at gmail.com> wrote:
>> After asking this question:
>> I found out that the new infix operator for `mappend` is (<>). I'm wondering
>> why ghc 7.4 didn't generalize (++) to work on monoids instead.
> Such decisions should really be made by the Haskell Prime committee
> (vs GHC HQ). In Haskell there is a continuing tension between making
> things polymorphic and to keep the prelude functions monomorphic so
> they generate simple error messages (among other arguments). At the
> point, the additional argument of any new definition of "Haskell"
> remaining backwards compatible also holds weight and this slows the
> This is not a new issue, there are a number of functions that could be
> defined more generally (common example: map/fmap). The problem making
> such changes is a matter of consensus and will to see things though.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe