Proposal: Add concatMapM function (#2042)

Henning Thielemann lemming at henning-thielemann.de
Tue Jan 29 10:42:30 EST 2008


On Tue, 29 Jan 2008, Thomas Schilling wrote:

> On Tue, 2008-01-29 at 12:18 +0000, Neil Mitchell wrote:
> > Hi
> >
> > >    1. In favor:
> > >       - Twan van Laarhoven
> > >       - Isaac Dupree
> > >       - Don Stewart
> > >       - Neil Mitchell
> > >
> > >    3. Opposed to any additions to the base library:
> > >       - Bulat Ziganshin
> >
>
> Is concatMapM vs concat <$> mapM really such an improvement?  Maybe the
> proposal should rather be to remove concatMap, for it is merely a
> 3-character shorter version of concat . map...

 "(concat . map f) xs"
   is 5 characters longer than
 "concatMap f xs"
  !

Alternatives
  concat $ map f xs
  concat (map f xs)

What about
  zipWith concatMap
 vs.
  zipWith (\f -> concat . map f)


So far I used concatMap a lot and thus I think it's addition was valuable.


More information about the Libraries mailing list