hindent-6.0.0: Extensible Haskell pretty printer
Safe HaskellSafe-Inferred
LanguageHaskell2010

HIndent.Pretty.Combinators.Indent

Description

Printer combinators related to indent.

Synopsis

Documentation

indentedBlock :: Printer a -> Printer a Source #

This function runs the given printer with an additional indent. The indent has configIndentSpaces spaces.

indentedWithSpace :: Int64 -> Printer a -> Printer a Source #

This function runs the given printer with an additional indent. The indent has the specified number of spaces.

(|=>) :: Printer () -> Printer a -> Printer a infixl 1 Source #

This function runs the first printer, fixes the indent, and then runs the second one.

For example,

string "foo " |=> lined [string "bar", "baz"]

will print texts as below. foo bar baz

indentedWithFixedLevel :: Int64 -> Printer a -> Printer a Source #

This function runs the given printer with the passed indent level.

prefixed :: String -> Printer () -> Printer () Source #

Prints the text passed as the first argument before the current position and then the second argument.

getIndentSpaces :: Printer Int64 Source #

This function returns the current indent level.