Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module contains functions which operate on supersets of Bytes
containing ASCII-encoded text.
That is, none of the functions here inspect bytes with a value greater than 127, and do not fail due to the presence of such bytes.
Line-Oriented IO
hFoldLines :: Handle -> a -> (a -> Bytes -> IO a) -> IO a Source #
Perform an action on each line of the input, threading state through the computation.
If you do not need to keep a state, see hForLines_
.
Lines are extracted with with hGetLine
, which does not document its
detection algorithm. As of writing (bytestring v0.11.1.0), lines are
delimited by a single n
character (UNIX-style, as all things should be).
hForLines_ :: Handle -> (Bytes -> IO a) -> IO () Source #
Perform an action on each line of the input, discarding results.
To maintain a running state, see hFoldLines
.
Lines are extracted with with hGetLine
, which does not document its
detection algorithm. As of writing (bytestring v0.11.1.0), lines are
delimited by a single n
character (UNIX-style, as all things should be).