Floskell.Buffer
Description
An outout buffer for Text that keeps track of line and column numbers.
data Buffer Source #
empty :: Buffer Source #
An empty output buffer.
newline :: Buffer -> Buffer Source #
Append a newline to the output buffer.
write :: Text -> Buffer -> Buffer Source #
Append a Text to the output buffer. It is an error for the string to contain newlines.
line :: Buffer -> Int Source #
Return the current line number, counting from 0.
column :: Buffer -> Int Source #
Return the column number, counting from 0.
toLazyText :: Buffer -> Text Source #
Return the contents of the output buffer as a lazy Text.