[Haskell-cafe] Monad fold

Arseniy Alekseyev arseniy.alekseyev at gmail.com
Tue Apr 16 16:04:24 CEST 2013


Hi!

Although foldM won't make things much nicer, it can be used here as well:

someA >>= \a -> foldM (flip id) a list


Cheers!
Arseniy

On 16 April 2013 13:35, Christopher Howard
<christopher.howard at frigidcode.com> wrote:
> So, I'm doing something like this
>
> foldl (>>=) someA list :: Monad m => m a
>
> where
>   list :: Monad m => [a -> m a],
>   someA :: Monad m => m a
>
> Is there a more concise way to write this? I don't think foldM is what I
> want -- or is it?
>
> --
> frigidcode.com
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



More information about the Haskell-Cafe mailing list