[Haskell-cafe] Monad fold

Oliver Charles ollie at ocharles.org.uk
Tue Apr 16 14:53:19 CEST 2013


On 04/16/2013 01:47 PM, Lyndon Maydwell wrote:
> You could do:
>
> runKleisli . mconcat . map Kleisli :: Monoid (Kleisli m a b) => [a -> 
> m b] -> a -> m b
>
> Would that work for you?
I can't find an instance for Monoid (Kleisli m a b) in `base`, so 
presumably the author would also have to write this instance? If so - 
would that really be any different to using that fold?

- Ollie



More information about the Haskell-Cafe mailing list