package alba
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=203ee151ce793a977b2d3e66f8b3a0cd7a82cc7f15550c63d88cb30c71eb5f95
md5=64367c393f80ca784f88d07155da4fb0
doc/alba.fmlib/Fmlib/Pretty_printer/Pretty/index.html
Module Pretty_printer.Pretty
Customizable pretty printer: Works with any printer which satisfies the PRINTER interface.
Parameters
Signature
include SIG
val empty : t
The printer which prints nothing.
val substring : string -> int -> int -> t
substring s pos len
: pretty printer printing a substring of s
starting at pos
and having length len
.
val string : string -> t
string s
: pretty printer printing the string s
.
val char : char -> t
char s
: pretty printer printing the character c
.
val fill : int -> char -> t
fill n c
: pretty printer printing the character c
n
times.
val line : string -> t
text s
: pretty printer printing an optional line break with the alternative text s
.
val cut : t
pretty printer printing an optional line break with no alternative text.
val space : t
pretty printer printing an optional line break with a blank as alternative text.
nest i pp
: pretty printer printing the same content as pp
but doing an additional indent of i
at each line break.
nest i pp
: pretty printer printing the same content as pp
but doing an additional indent of i
relative to the current position at each line break.
group pp
: treat all line breaks appearing in pp
consistently i.e. either output all as line breaks or all with their alternative text.
val wrap_words : string -> t
wrap_words s
: Print the string s
with all the words in it potentially wrapped.
val fill_paragraph : string -> t
fill_paragraph s
: Print the string s
as a paragraph i.e. putting as many words on a line as possible.