Module

Dodo.Internal

Package
purescript-dodo-printer
Repository
natefaubion/purescript-dodo-printer

#Position Source

type Position = { column :: Int, indent :: Int, line :: Int, nextIndent :: Int, pageWidth :: Int, ribbonWidth :: Int }

Document lines and columns are 0-based offsets.

#Doc Source

data Doc a

Documents are built using <> as horizontal, line-wise concatenation. The functions in this module let you build documents that respond well to width constraints (such as flexGroup and flexAlt).

Constructors

Instances

#LocalOptions Source

type LocalOptions = { indent :: Int, indentSpaces :: String, indentUnit :: String, indentWidth :: Int, pageWidth :: Int, ribbonRatio :: Number }

#bothNotEmpty Source

bothNotEmpty :: forall a. (Doc a -> Doc a -> Doc a) -> Doc a -> Doc a -> Doc a

Only applies the provided function if both documents are non-empty, otherwise just yields whichever is non-empty.

#notEmpty Source

notEmpty :: forall a. (Doc a -> Doc a) -> Doc a -> Doc a

Only applies the provided function if the document is non-empty.

#isEmpty Source

isEmpty :: forall a. Doc a -> Boolean

Checks whether the document is empty.