iteratee [PATCH] add last, mapM_
Conrad Parker
conrad at metadecks.org
Tue Aug 24 20:35:42 EDT 2010
The attached patches to iteratee-0.3 add functions for last and mapM_.
-- | Attempt to skip to the last element of the stream and return it
last :: (SC.StreamChunk s el, Monad m) => IterateeG s el m el
-- | Map a monadic function over all elements of a stream, and ignore the result
mapM_ :: (LL.ListLike (s el) el, MonadIO m)
=> (el -> m ()) -> IterateeG s el m ()
(This and the recent patches I sent for ioIter and enumFollowFd are a
resend of patches that were sent to John Lato earlier. There
was a discussion about the implementation of last, which here just
uses the existing monadic functions, rather than inspecting the
stream Chunks directly. It may be more efficient to deal directly with
the Chunks).
cheers,
Conrad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-last-iteratee.dpatch
Type: application/octet-stream
Size: 3504 bytes
Desc: not available
Url : http://projects.haskell.org/pipermail/iteratee/attachments/20100825/51416de8/attachment.obj
More information about the Iteratee
mailing list