Proposal: Add concatMapM function (#2042)

Conor McBride conor at
Tue Jan 29 07:53:41 EST 2008


On 29 Jan 2008, at 12:29, Neil Mitchell wrote:

> Hi
>>> I think we should ignore the generalization to
>>> genericSuperDuperConcatMapMXYZ for now :).
>> Why?
> Orthogonality.

What's orthogonal to what, here? I'm trying
to understand why the generalization is
irrelevant (or merely unwelcome) to the
discussion of whether or not the special case
should be added to the library.

> It is silly to have have superConcatMapM, but not
> superMapM. If that wants doing it should be a separate proposal after
> this one.

If you peer at it closely, you'll notice that
traverse is kind of like a generalized mapM.

If you peer at it closely, you'll notice that
concatMapM, apart from being unnecessarily
specific to lists and unnecessarily specific
to monads, is a newtype isotope of foldMap.

Is it worth thinking a bit more about how to
exploit the functionality that's already in
the library?

All the best


More information about the Libraries mailing list