Module

Dodo.Internal

#Position

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

Document lines and columns are 0-based offsets.

#Doc

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

#bothNotEmpty

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

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

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

#isEmpty

isEmpty :: forall a. Doc a -> Boolean

Checks whether the document is empty.

Modules