diff --git a/dev/containers/Containers_pp/Dump/index.html b/dev/containers/Containers_pp/Dump/index.html new file mode 100644 index 00000000..20a4be3c --- /dev/null +++ b/dev/containers/Containers_pp/Dump/index.html @@ -0,0 +1,2 @@ + +
Containers_pp.DumpPrinters that correspond closely to OCaml's syntax.
Containers_pp.ExtExtension node.
Custom nodes can be used to add user-defined behavior to the rendered output. For example, documents might be annotated with ANSI-terminal colors, or with HTML tags.
type 'a t = {pre : Out.t -> 'a -> unit;Printed before the wrapped value.
*)post : Out.t -> 'a -> unit;Printed after the wrapped value.
*)}An extension is a custom document node. It takes a value of type 'a, and a document d, and can output what it wants based on the custom value before and after d is printed.
The extension is considered to have width 0.
Containers_pp.FlattenTrivial printing, on a single line.
This is generally ugly, but it's simple and fast when we do not care about looks.
val to_buffer : Stdlib.Buffer.t -> t -> unitval to_string : t -> stringContainers_pp.InfixContainers_pp.OutArbitrary output.
This is used for user-provided output.
val of_buffer : Stdlib.Buffer.t -> tval char : t -> char -> unitval string : t -> string -> unitval sub_string : t -> string -> int -> int -> unitval newline : t -> unitContainers_pp.PrettyPretty-printing.
These functions are parametrized by a width, and will try to fit the result within this width.
val to_string : width:int -> t -> stringRender to a string.
val to_buffer : width:int -> Stdlib.Buffer.t -> t -> unitRender to a buffer.
val to_format : width:int -> Stdlib.Format.formatter -> t -> unitContainers_pp.Term_colorSimple colors in terminals
Containers_ppPretty printing of documents.
A document is a structured tree of text with formatting instructions.
It can be rendered into a string ("pretty printed"), see Pretty.
This follows Wadler's paper "A prettier printer", but with some changes in the rendering part because we can't rely on lazyness to make the algebraic implementation efficient.
Some general considerations: the type t is the type of documents, a tree with text leaves that is pretty printed within a given width.
Layout is controlled via the combination of a few primitives:
newline will either print a space or a newline. It is similar to Format's "@ " in that sense. A big difference with Format is that by default newline is actually a newline. It only becomes a space if it's in a group small enough to fit in the remainder of the current line.group d tries to write d on a single line if there's room. If not, it has no effect.nest n d increases the indentation level inside d. Any newline that is rendered as a new line is indented by n more spaces (which are cumulative with surrounding nest calls).append a b (or a ^ b) just prints a followed by b.fill d is a bit like group but it will try to cram as much as possible on each line. It is not all-or-nothing like group.val nil : tEmpty document
val char : char -> tSingle char.
Text, with a Printf-compatible format.
For example, textpf "%d-%d" 4 2 is like text "4-2".
val textf : ('a, Stdlib.Format.formatter, unit, t) format4 -> 'aText, with a Format-compatible format.
Note that this will bake-in any formatting done by Format. Newlines introduced by format will become hard newlines in the resulting document.
nest n d increases indentation by n inside d. If current indentation is m, then every newline inside d will be followed by n + m leading spaces.
Group the documents inside this.
Newlines immediately inside this group will either render as new lines or as spaces, depending on the width available.
val newline : tA line break.
fill sep l resembles group (append_l ~sep l), except it tries to put as many items of l as possible on each line.
In terms of Format, this is like the hov box.
module Out : sig ... endArbitrary output.
module Ext : sig ... endExtension node.
ext e v d wraps d with value v.
It is a document that has the same shape (and size) as d, except that additional data will be output when it is rendered using extension e.
When this is rendered, first e.pre out v is called; then d is printed; then e.post out v is called. Here out is the output buffer/stream for rendering.
module Pretty : sig ... endPretty-printing.
module Flatten : sig ... endTrivial printing, on a single line.
val pp : Stdlib.Format.formatter -> t -> unitPretty-print, using Pretty and an unspecified margin.
val debug : Stdlib.Format.formatter -> t -> unitmodule Infix : sig ... endval sp : tA single space
append_l ?sep l is the concatenation of elements of l, separated by sep (default nil)
val bool : bool -> tval int : int -> tval float : float -> tval float_hex : float -> tval text_quoted : string -> ttext_quoted s is text (spf "%S" s)
val text_zero_width : string -> tText but we assume it takes no space on screen.
of_list f l maps each element of l to a document and concatenates them.
val of_seq : ?sep:t -> ('a -> t) -> 'a Stdlib.Seq.t -> tSame as of_list but with sequences.
bracket2 l d r groups d, indented by 2, between brackets l and r
module Dump : sig ... endPrinters that correspond closely to OCaml's syntax.
module Term_color : sig ... endSimple colors in terminals
CCArray Array utilsCCArrayLabels Array utils (Labeled version of CCArray)CCAtomic CCBool Basic Bool functionsCCByte_buffer Byte buffer.CCCanonical_sexp Canonical S-expressionsCCChar Utils around charCCEither Either MonadCCEqual Equality CombinatorsCCEqualLabels Equality Combinators (Labeled version of CCEqual)CCFloat Basic operations on floating-point numbersCCFormat Helpers for FormatCCFun Basic operations on FunctionsCCHash Hash combinatorsCCHashtbl Extension to the standard HashtblCCHeap Leftist HeapsCCIO IO UtilsCCInt Basic Int functionsCCInt32 Helpers for 32-bit integers.CCInt64 Helpers for 64-bit integers.CCList Complements to ListCCListLabels Complements to ListLabelsCCMap Extensions of Standard MapCCMonomorphic CCNativeint Helpers for processor-native integersCCOpt Previous Option moduleCCOption Basic operations on the option type.CCOrd Order combinatorsCCPair Tuple FunctionsCCParse Very Simple Parser CombinatorsCCRandom Random GeneratorsCCRef Helpers for referencesCCResult Error MonadCCSeq Helpers for the standard Seq typeCCSet Wrapper around SetCCSexp Handling S-expressionsCCSexp_intf CCSexp_lex CCShims_ CCShims_syntax CCString Basic String UtilsCCStringLabels Basic String Utils (Labeled version of CCString)CCUnit CCUnix CCUtf8_string Unicode String, in UTF8CCVector Growable, mutable vectorContainers Drop-In replacement to StdlibContainersLabels Drop-In replacement to StdlibContainers_bencode Basic Bencode decoder/encoder.Containers_cbor CBOR encoder/decoder.Containers_codegen Containers_scc Containers_top CCArray Array utilsCCArrayLabels Array utils (Labeled version of CCArray)CCAtomic CCBool Basic Bool functionsCCByte_buffer Byte buffer.CCCanonical_sexp Canonical S-expressionsCCChar Utils around charCCEither Either MonadCCEqual Equality CombinatorsCCEqualLabels Equality Combinators (Labeled version of CCEqual)CCFloat Basic operations on floating-point numbersCCFormat Helpers for FormatCCFun Basic operations on FunctionsCCHash Hash combinatorsCCHashtbl Extension to the standard HashtblCCHeap Leftist HeapsCCIO IO UtilsCCInt Basic Int functionsCCInt32 Helpers for 32-bit integers.CCInt64 Helpers for 64-bit integers.CCList Complements to ListCCListLabels Complements to ListLabelsCCMap Extensions of Standard MapCCMonomorphic CCNativeint Helpers for processor-native integersCCOpt Previous Option moduleCCOption Basic operations on the option type.CCOrd Order combinatorsCCPair Tuple FunctionsCCParse Very Simple Parser CombinatorsCCRandom Random GeneratorsCCRef Helpers for referencesCCResult Error MonadCCSeq Helpers for the standard Seq typeCCSet Wrapper around SetCCSexp Handling S-expressionsCCSexp_intf CCSexp_lex CCShims_ CCShims_syntax CCString Basic String UtilsCCStringLabels Basic String Utils (Labeled version of CCString)CCUnit CCUnix CCUtf8_string Unicode String, in UTF8CCVector Growable, mutable vectorContainers Drop-In replacement to StdlibContainersLabels Drop-In replacement to StdlibContainers_bencode Basic Bencode decoder/encoder.Containers_cbor CBOR encoder/decoder.Containers_codegen Containers_pp Pretty printing of documents.Containers_scc Containers_top