Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Util.PpSourcePretty-printing combinators that generate valid OCaml syntax for common types along with combinators for user-defined types
The type of pretty-printers to valid OCaml syntax. The bool argument asks the printer to wrap its output inside parentheses if it produces a non-atomic expression.
to_show pp converts a pretty-printer to a simple 'a -> string function that generate everything on one line. If the environment variable MCTUTILS_TRUNCATE is set to a length, it will truncate the resulting string if it exceeds that length.
of_show show uses a simple 'a -> string function as a pretty-printer. Unfortunately, it will wrap the resulting string with parentheses in more cases than strictly necessary.
cst0 name fmt pretty-prints a constructor name with no argument.
cst1 pp name par v fmt pretty-prints a constructor name with one parameter, using pp to pretty-print its argument v, wrapping itself into parentheses when par.
cst2 pp1 pp2 name par v1 v2 fmt pretty-prints a constructor name with two parameters, using ppi to pretty-print its argument vi, wrapping itself into parentheses when par.
val cst3 :
'a t ->
'b t ->
'c t ->
string ->
bool ->
Format.formatter ->
'a ->
'b ->
'c ->
unitcst3 pp1 pp2 pp3 name par v1 v2 v3 fmt pretty-prints a constructor name with three parameters, using ppi to pretty-print its argument vi, wrapping itself into parentheses when par.
val cst4 :
'a t ->
'b t ->
'c t ->
'd t ->
string ->
bool ->
Format.formatter ->
'a ->
'b ->
'c ->
'd ->
unitcst4 pp1 pp2 pp3 pp4 name par v1 v2 v3 v4 fmt pretty-prints a constructor name with four parameters, using ppi to pretty-print its argument vi, wrapping itself into parentheses when par.
val cst5 :
'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
string ->
bool ->
Format.formatter ->
'a ->
'b ->
'c ->
'd ->
'e ->
unitcst5 pp1 pp2 pp3 pp4 pp5 name par v1 v2 v3 v4 v5 fmt pretty-prints a constructor name with five parameters, using ppi to pretty-print its argument vi, wrapping itself into parentheses when par.
Pretty-printer for exceptions reusing the standard Printexc.to_string. The exception message will be wrapped conservatively (ie too often) in parentheses.
pp_option pp pretty-prints a value of type 'a option using pp to pretty-print values of type 'a.
pp_result pp_ok pp_error pretty-prints a value of type ('o, 'e) result using pp_ok to pretty-print values of type 'o and pp_error for values of type 'e.
The abstract type for the pretty-printer of a tuple item
pp_tuple_item pp v builds a pretty-printer for a tuple item using pp to pretty-print its value v.
pp_tuple pretty-prints a tuple taken as a list of pp_tuple_items.
pp_pair pp_a pp_b pretty-prints a value of type 'a * 'b using pp_a to pretty-print values of type 'a and pp_b for values of type 'b.
pp_tuple2 pretty-prints pairs, synonym for pp_pair.
pp_tuple4 pretty-prints tuples of 4 elements.
pp_tuple5 pretty-prints tuples of 5 elements.
val pp_tuple6 :
'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t ->
('a * 'b * 'c * 'd * 'e * 'f) tpp_tuple6 pretty-prints tuples of 6 elements.
val pp_tuple7 :
'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t ->
'g t ->
('a * 'b * 'c * 'd * 'e * 'f * 'g) tpp_tuple7 pretty-prints tuples of 7 elements.
val pp_tuple8 :
'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t ->
'g t ->
'h t ->
('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h) tpp_tuple8 pretty-prints tuples of 8 elements.
val pp_tuple9 :
'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t ->
'g t ->
'h t ->
'i t ->
('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h * 'i) tpp_tuple9 pretty-prints tuples of 9 elements.
val pp_tuple10 :
'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t ->
'g t ->
'h t ->
'i t ->
'j t ->
('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h * 'i * 'j) tpp_tuple10 pretty-prints tuples of 10 elements.
pp_list pp pretty-prints a list using pp to pretty-print its elements.
pp_seq pp pretty-prints a sequence using pp to pretty-print its elements.
pp_array pp pretty-prints an array using pp to pretty-print its elements.
The abstract type for the pretty-printer of a record field
pp_field name pp v builds a pretty-printer for a record field of given name using pp to pretty-print its content value v.
pp_record flds pretty-prints a record using the list of pretty-printers of its fields.