Copyright | 2013-2017 Luis Pedro Coelho |
---|---|
License | MIT |
Maintainer | luis@luispedro.org |
Safe Haskell | Safe |
Language | Haskell2010 |
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