nest -package:liquidhaskell-boot
(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).
Nest (or indent) a document by a given number of positions (which may
also be negative).
nest satisfies the laws:
The side condition on the last law is needed because
empty is a
left identity for
<>.
Nest (or indent) a document by a given number of positions (which may
also be negative).
nest satisfies the laws:
The side condition on the last law is needed because
empty is a
left identity for
<>.
Indent
SDoc some specified amount
Nest (or indent) a document by a given number of positions (which may
also be negative).
nest satisfies the laws:
The side condition on the last law is needed because
empty is a
left identity for
<>.
Compositional power of a function, i.e. apply the function n
times to a value. It is rather the same as iter in Simon
Thompson: "The Craft of Functional Programming", page 172
Nest a fold in an applicative.
The document
(nest i x) renders document
x with the
current indentation level increased by
i (See also
hang,
align and
indent).
nest 2 (text "hello" <$> text "world") <$> text "!"
outputs as:
hello
world
!
The document
(nest i x) renders document
x with the
current indentation level increased by
i (See also
hang,
align and
indent).
nest 2 (text "hello" <$> text "world") <$> text "!"
outputs as:
hello
world
!
The document
(nest i x) renders document
x with the
current indentation level increased by i (See also
hang,
align and
indent).
nest 2 (text "hello" <$> text "world") <$> text "!"
outputs as:
hello
world
!
The document
nest i d renders the document
d
with the current indentation level increased by
i.
Indents a
Doc by the specified number of spaces.
The document
(nest i x) renders document
x with the
current indentation level increased by i (See also
hang,
align and
indent).
nest 2 (text "hello" <#> text "world") <#> text "!"
outputs as:
hello
world
!
The document
(nest i x) renders document
x with the
current indentation level increased by i (See also
hang,
align and
indent).
nest 2 (fromString "hello" <> line <> fromString "world")
<> line
<> fromString "!"
outputs as:
hello
world
!
The document
(nest i x) renders document
x with the
current indentation level increased by i (See also
hang,
align and
indent).
nest 2 (text "hello" <$> text "world") <$> text "!"
outputs as:
hello
world
!
Compositional power of a function, i.e. apply the function n times to
a value.
Not on Stackage, so not searched.
Indents a
Doc by the specified number of spaces.
This indicates that the pointer parameter can be excised using the
trampoline intrinsics.
Document indented by a number of columns