Library
Module
Module type
Parameter
Class
Class type
SmartPrint library.
val empty : t
The empty document.
val string : string -> t
A non-breakable string. The string should be newlines free.
val sub_string : string -> int -> int -> t
A non-breakable string pointing to the sub-string of an existing string. Does not duplicate the sub-string. The sub-string is indexed by its offset and its length.
val (!^) : string -> t
A shortcut for string
.
val space : t
A breakable space.
val newline : t
A newline.
Concatenation of two documents with a breakable space in between. Like d1 ^-^ space ^-^ d2
.
val words : string -> t
Split a non-unicode string into words and breakable spaces.
val lines : string -> t
Split a non-unicode string into lines at each newline.
Group a document, breaking spaces only when necessary. Indent when spaces are broken.
Group a document, breaking all spaces if the line is full. Indent when spaces are broken.
Group a document, breaking spaces only when necessary. Do not indent when spaces are broken.
Group a document, breaking all spaces if the line is full. Do not indent when spaces are broken.
Concatenate the list of documents with no space. concat [d1; ...; dn] = d1 ^-^ ... ^-^ dn
Concatenate the list of documents with no space but adding a separator in between. separate sep [d1; ...; dn] = d1 ^-^ sep ^-^ d2 ^-^ sep ... sep ^-^ dn
module OCaml : sig ... end
Pretty-printing of OCaml values.
module Debug : sig ... end
A pretty-printer for the pretty-printer itself.
val to_something :
int ->
int ->
(char -> unit) ->
(string -> unit) ->
(string -> int -> int -> unit) ->
t ->
unit
Render a document with a maximal width
per line and a tabulation size. Uses the functions add_char
, add_string
and add_sub_string
given.
Render a document in a buffer with a maximal width
per line and a tabulation size.
val to_string : int -> int -> t -> string
Render a document in a string with a maximal width
per line and a tabulation size.
val to_out_channel : int -> int -> Pervasives.out_channel -> t -> unit
Render a document in an output channel with a maximal width
per line and a tabulation size.
val to_stdout : int -> int -> t -> unit
Render a document on stdout
with a maximal width
per line and a tabulation size.