S. Alexander Jacobson writes:

> I don't think that is right.  concatMap has definition
> 
>    concatMap :: (a -> [b]) -> [a] -> [b]
>    concatMap f xs = concat $ map f xs
> 
> Therefore:
> 
>    msumMap :: (MonadPlus m) => (a1 -> m a) -> [a1] -> m a
>    msumMap f list = msum $ fmap f list

Assuming your goal is to generalize by replacing (++) with mplus, you
want this:

    msumMap f = foldr (mplus . f) mzero

It isn't in the standard libraries, so you'll have to define it
yourself.
-- 
David Menendez <[EMAIL PROTECTED]> | "In this house, we obey the laws
<http://www.eyrie.org/~zednenem>      |        of thermodynamics!"
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to