package coq-core
Install
Dune Dependency
Authors
Maintainers
Sources
md5=8d852367b54f095d9fbabd000304d450
sha512=46922d5f2eb6802a148a52fd3e7f0be8370c93e7bc33cee05cf4a2044290845b10ccddbaa306f29c808e7c5019700763e37e45ff6deb507b874a4348010fed50
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.
Prints pr v
if ov
is Some v
, else prdf ()
.
Same as pr_opt_default
but without the leading space.
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
.
pr_choice pr [a ; b ; ... ; c]
outputs pr a ++ str "," ++ spc () ++ pr b ++ str "," ++ spc () ++ ... ++ str "or" ++ 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