Module

Text.Doc

Package
purescript-text
Repository
dmkolobov/purescript-text

#Doc Source

data Doc

Constructors

Instances

#inline Source

inline :: String -> Doc

Returns an inline document containing the given string.

#block Source

block :: Seq Doc -> Doc

Returns a block document containing the given documents.

#ws Source

ws :: Int -> String

Returns a string of white space of length n.

#print Source

print :: Int -> Doc -> String

Takes an accumulator containing the identation and a doc, and returns a string representing that doc.

#inlined Source

inlined :: Doc -> String

Show the enire document as a single line and return that string representation.

#indent Source

indent :: Int -> Doc -> Doc

Indent the entire doc n spaces.

#beside Source

beside :: String -> Doc -> Doc

Places the given string to the left of the given doc, shifting the rest of the doc so that the indentation is preserved.

#prefix Source

prefix :: String -> Doc -> Doc

Prepends a string to the first line in the document and shifts lines in the same block as that line to preserve indentation.

#flow Source

flow :: Doc -> Doc -> Doc

Places the second document after the last line of the first document. The second document is shifted so that indentation is preserved.

#(:>) Source

Operator alias for Text.Doc.flow (right-associative / precedence 4)

#indentBlock Source

indentBlock :: Int -> Doc -> Doc

Indent all but the first line of the given document by n spaces.

#between Source

between :: String -> String -> Doc -> Doc

Returns the given doc with surrounded with the given open and close strings.

#parens Source

parens :: Doc -> Doc

Returns the given doc surrounded with parenthesis.

#brackets Source

brackets :: Doc -> Doc

Returns the given doc surrounded with square brackets.

#braces Source

braces :: Doc -> Doc

Returns the given doc surrounded with curly braces.

#isEmpty Source

isEmpty :: Doc -> Boolean

Returns true when given the empty doc.

#intermix Source

intermix :: String -> Doc -> Doc

Place the given string beside every line in the given doc but the first.

Modules
Text.Doc