floskell-0.11.1: A flexible Haskell source code pretty printer
Safe HaskellSafe-Inferred
LanguageHaskell2010

Floskell.Buffer

Description

An outout buffer for Text that keeps track of line and column numbers.

Synopsis

Documentation

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.