On Tue, 2009-12-29 at 18:20 +0000, Conor McBride wrote: > Hi Tony > > On 29 Dec 2009, at 12:10, Tony Morris wrote: > > > Can (liftM join .) . mapM be improved? > > (Monad m) => (a -> m [b]) -> [a] -> m [b] > > You can > > (a) generalize m from Monad to Applicative > (b) generalize [b] to any Monoid > (c) generalize [a] to f a for any Foldable f > > and write > > ala AppLift foldMap > > if you happen to have some of my usual kit. See below. > > Cheers > > Conor
What is benefit of it over: concatMapA f = foldr (liftA2 mappend . f) (pure mempty) Regards _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe