nest package:optparse-applicative

(nest i x) lays out the document x with the current nesting level (indentation of the following lines) increased by i. Negative values are allowed, and decrease the nesting level accordingly.
>>> vsep [nest 4 (vsep ["lorem", "ipsum", "dolor"]), "sit", "amet"]
lorem
ipsum
dolor
sit
amet
See also
  • hang (nest relative to current cursor position instead of current nesting level)
  • align (set nesting level to current cursor position)
  • indent (increase indentation on the spot, padding with spaces).
Layout a document depending on the current nesting level. align is implemented in terms of nesting.
>>> let doc = "prefix" <+> nesting (\l -> brackets ("Nested:" <+> pretty l))

>>> vsep [indent n doc | n <- [0,4,8]]
prefix [Nested: 0]
prefix [Nested: 4]
prefix [Nested: 8]
Render flattened text on this line, or start a new line before rendering any text. This will also nest subsequent lines in the group.