Page
Library
Module
Module type
Parameter
Class
Class type
Source
TreeprintSourcePretty printing combinator based on Format with automatic parenthese insertion
Operator precedence. Smaller is stronger.
Type of the pretty printer combinator: under the given assoc position and precendence level, compute some 'a
Pretty printer combinator is a state monad
include Spotlib.Spot.Monad.T with type 'a t := 'a tIteration with index starting from 0. Not tail recursive by default
for like iteration. Not tail recursive by default
 1 Basic printer functions 
box n ppr creates a horizontal layout box. An internal call of space and cut may cause a line break if the entire contents do not fit with the current printable width. If a line break is required the following contents are printed with additional indentation of n.
vbox n ppr creates a vertical layout box. If the entire contents do not fit with the current printable width, all calls of space and cut cause line breaks. If a line break is required the following contents are printed with additional indentation of n.
 1 Level and environments 
Compare the argument against the current level: `Same : the same as the current level `Stronger : the argument is stronger than the current `Weak : the argument is weaker than the current
Check the printer object of assoc and level requires parenthesis wrapping or not in the current environment
These implements common printing with auto parenthesis wrapping. Note: They may not suit with your own taste.
left and right parenthese. The default is "(" and ")"
parenbox ?parens assoc level ppr pretty-prints ppr as an object of associativity assoc and precedence level. Parentheses '(' and ')' are automatically wrapped when required.
binop ?parens assoc level ~op left right pretty prints binary operation <left> <op> <right> where op has assoc and level. Parentheses '(' and ')' are automatically wrapped when required.
list ?parens lev sep pprs is to create a list without a box. lev is the level of the separator sep. Parentheses '(' and ')' are automatically wrapped when required.
prefix ?parens level ~op p pretty-prints an prefix operator application expression <op> <p> where op's level is level. Parentheses '(' and ')' are automatically wrapped when required.
postfix ?parens level ~op p pretty-prints an postfix operator application expression <p> <op> where op's level is level. Parentheses '(' and ')' are automatically wrapped when required.
parens left right ppr surrounds ppr with the left and right strings. The level used for pretty-printing the internal ppr is reset to -1.0 to prevent from having auto parens for it
Printing combinators which use the same operator assciativity and precedence as OCaml language.
val format : 
  ?assoc:assoc ->
  ?level:level ->
  ('a -> ppr) ->
  Spotlib.Spot.Format.t ->
  'a ->
  unitformat ?assoc ?level conv ppf a pretty-prints a using the conversion function conv to the formatter ppf. The initial associativity and level are given by assoc and level.
buffer conv buf ?assoc ?level a pretty-prints a using the conversion function conv to the buffer buf. The initial associativity and level are given by assoc and level.
show conv ?assoc ?level a pretty-prints a using the conversion function conv then returns the result as a string. The initial associativity and level are given by assoc and level.
Functor version of drivers