add concatMapM to base in control.monad

Carter Schonwald carter.schonwald at gmail.com
Fri Feb 8 18:41:53 UTC 2019


That does seem nice.

I don’t actually have a horse in this race mind you , I was merely relaying
a privately communicated from a friend proposal for feedback about its
merits etc.

On Fri, Feb 8, 2019 at 12:57 PM Evan Laforge <qdunkan at gmail.com> wrote:

> As long as we're playing the permutation game, I also frequently use
> mconcatMap, and mconcatMapM.  Actually, my concatMapM is secretly
> '(Monad m, Monoid b) => (a -> m b) -> [a] -> m b', but I suppose you
> could argue that's inconsistent with the existing naming scheme.
>
> I guess I don't mind it because unlike the generalization of [a] to
> Foldable a, I haven't had ambiguity problems with generalizing [a] to
> Monoid a.  Just personal experience though.
>
> On Fri, Feb 8, 2019 at 9:04 AM Carter Schonwald
> <carter.schonwald at gmail.com> wrote:
> >
> > friend asked me to raise this
> >
> > previously https://ghc.haskell.org/trac/ghc/ticket/2042
> > seems like it iddn't happen last time because base lived outside of ghc?
> >
> > -- | The 'concatMapM' function generalizes 'concatMap' to arbitrary
> monads.
> > concatMapM        :: (Monad m) => (a -> m [b]) -> [a] -> m [b]
> > concatMapM f xs   =  liftM concat (mapM f xs)
> >
> > _______________________________________________
> > Libraries mailing list
> > Libraries at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190208/f1c6e2c5/attachment.html>


More information about the Libraries mailing list