Copyright | 2013-2017 Luis Pedro Coelho |
---|---|
License | MIT |
Maintainer | [email protected] |
Safe Haskell | Safe |
Language | Haskell2010 |
Data.Conduit.Algorithms.Utils
Description
A few miscellaneous conduit utils
Documentation
awaitJust :: Monad m => (a -> Conduit a m b) -> Conduit a m b Source #
Act on the next input (do nothing if no input). awaitJust f
is equivalent to
do next <- C.await case next of Just val -> f val Nothing -> return ()
This is a simple utility adapted from http://neilmitchell.blogspot.de/2015/07/thoughts-on-conduits.html