[Proposal] Add default implementation of mappend/mempty in terms of mconcat

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Mon Jan 27 16:17:45 UTC 2014

On 27/01/14 13:29, Tom Ellis wrote:
> On Mon, Jan 27, 2014 at 12:32:04PM +0000, Mateusz Kowalczyk wrote:
>> On 27/01/14 12:26, Henning Thielemann wrote:
>>> Am 27.01.2014 13:23, schrieb Joachim Breitner:
>>>> Hi,
>>>> Am Montag, den 27.01.2014, 11:42 +0100 schrieb Sjoerd Visscher:
>>>>> This seems rather pointless; I’m having trouble coming up with an
>>>>> example where mconcat would be easier or more elegant to implement. Do
>>>>> you have an example?
>>>> maybe cases where you implement mconcat for performance reasons anyways
>>>> (but are there good examples for that?),
>>> I think it is useful to define a custom mconcat in cases where it
>>> matters whether it is a left or a right fold.
>>>  > and then you don’t want to be bothered with the simple cases....
>> You can still define your own mconcat and not use the default
>> definition. There's no case for this proposal from that aspect.
> Sure, but if you are going to define your own mconcat for performance
> reasons, it would then be nice not to *have to* define your own mappend, or
> mempty.
> Tom
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries

Oh, sorry, I haven't read the original post and jumped to conclusions.

+1 from me

Mateusz K.

More information about the Libraries mailing list