package coq
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=3cbfc1e1a72b16d4744f5b64ede59586071e31d9c11c811a0372060727bfd9c3
doc/coq-core.lib/Pp/index.html
Module Pp
Source
Coq document type.
Pretty printing guidelines
Pp.t
is the main pretty printing document type in the Coq system. Documents are composed laying out boxes, and users can add arbitrary tag metadata that backends are free to interpret.
The datatype has a public view to allow serialization or advanced uses, however regular users are _strongly_ warned against its use, they should instead rely on the available functions below.
Box order and number is indeed an important factor. Try to create a proper amount of boxes. The ++
operator provides "efficient" concatenation, but using the list constructors is usually preferred.
That is to say, this:
hov [str "Term"; hov (pr_term t); str "is defined"]
is preferred to:
hov (str "Term" ++ hov (pr_term t) ++ str "is defined")
Formatting commands
Manipulation commands
Derived commands
Boxing commands
Tagging
Printing combinators
Adds a space in front of its argument if non empty.
Inner object preceded with a space if Some
, nothing otherwise.
Concatenation of the list contents, without any separator.
Unlike all other functions below, prlist
works lazily. If a strict behavior is needed, use prlist_strict
instead.
prlist_with_sep sep pr [a ; ... ; c]
outputs pr a ++ sep () ++ ... ++ sep () ++ pr c
. where the thunk sep is memoized, rather than being called each place its result is used.
As prlist_with_sep
, but on arrays.
Indexed version of prvect_with_sep
.
pr_enum pr [a ; b ; ... ; c]
outputs pr a ++ str "," ++ spc () ++ pr b ++ str "," ++ spc () ++ ... ++ str "and" ++ spc () ++ pr c
.
Sequence of objects separated by space (unless an element is empty).
Main renderers, to formatter and to string
pp_with fmt pp
Print pp
to fmt
and don't flush fmt
Tag prefix to start a multi-token diff span
Tag prefix to end a multi-token diff span
Split a tag into prefix and base tag
Print the Pp in tree form for debugging