pipes-lines- Pipes for grouping by lines with carriage returns.

Safe HaskellSafe



This is equivalent to the http://hackage.haskell.org/package/pipes-text/docs/Pipes-Text.html#v:lines except it works for lines delimited with "\r\n"



lines :: Monad m => Lens' (Producer Text m r) (FreeT (Producer Text m) m r) Source #

Producer of strict Texts is delimited by "\r\n"

>>> runEffect $ for (over (lines . individually) (<* yield "!") (yield "asdf\r\nqwerty\r\n")) (lift . print)

unlines :: Monad m => Lens' (FreeT (Producer Text m) m r) (Producer Text m r) Source #

line :: Monad m => Producer Text m r -> Producer Text m (Producer Text m r) Source #

Producer which consumes a single line, then returns a producer with rest of input.

>>> rest <- runEffect $ for (line (yield "foo\r\nbar\r\nbaz\r\n")) (lift . print)
>>> runEffect $ for rest (lift . print)