iteratee New Iteratee: foldChunksM

John Lato jwlato at gmail.com
Tue Aug 16 19:23:53 BST 2011


I've added this, as well as mapChunksM.  I think the map/fold
offerings are mostly comprehensive at this point, except for
element-wise monadic maps.  I can add these if anyone needs them.

John

On Fri, Aug 12, 2011 at 6:44 AM, Michael Baikov <manpacket at gmail.com> wrote:
> It might be useful to have foldChunksM (implementation included at the
> bottom) along with foldM to complement
> the pair of mapChunksM_ with mapM_
>
> foldChunksM :: (Monad m, Nullable s) => (a -> s -> m a) -> a -> Iteratee s m a
> foldChunksM f = liftI . go
>    where
>        go a (Chunk c) = lift (f a c) >>= liftI . go
>        go a e = idone a e
>
> _______________________________________________
> Iteratee mailing list
> Iteratee at projects.haskell.org
> http://projects.haskell.org/cgi-bin/mailman/listinfo/iteratee
>



More information about the Iteratee mailing list