Floskell.Buffer

floskell-0.11.1: A flexible Haskell source code pretty printer

Safe Haskell | Safe-Inferred
Language | Haskell2010

Floskell.Buffer

Description

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

Synopsis

- data Buffer
- empty :: Buffer
- newline :: Buffer -> Buffer
- write :: Text -> Buffer -> Buffer
- line :: Buffer -> Int
- column :: Buffer -> Int
- toLazyText :: Buffer -> Text

# Documentation

data Buffer #

empty :: Buffer #

An empty output buffer.

newline :: Buffer -> Buffer #

Append a newline to the output buffer.

write :: Text -> Buffer -> Buffer #

Append a Text to the output buffer. It is an error for the string to contain newlines.

line :: Buffer -> Int #

Return the current line number, counting from 0.

column :: Buffer -> Int #

Return the column number, counting from 0.

toLazyText :: Buffer -> Text #

Return the contents of the output buffer as a lazy Text.