floskell-0.10.2: A flexible Haskell source code pretty printer

Safe HaskellSafe
LanguageHaskell98

Floskell.Buffer

Description

An outout buffer for ByteStrings 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 :: ByteString -> Buffer -> Buffer Source #

Append a ByteString 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.

toLazyByteString :: Buffer -> ByteString Source #

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