Module PPrintOCaml
A set of functions that construct representations of OCaml values.
type constructor
= string
type type_name
= string
type record_field
= string
type tag
= int
type representation
= PPrintEngine.document
A representation of a value is a
PPrint
document.
val variant : type_name -> constructor -> tag -> representation list -> representation
variant _ dc _ args
is a description of a constructed value whose data constructor isdc
and whose arguments areargs
. The other two parameters are presently unused.
val record : type_name -> (record_field * representation) list -> representation
record _ fields
is a description of a record value whose fields arefields
. The other parameter is presently unused.
val tuple : representation list -> representation
tuple args
is a description of a tuple value whose components areargs
.
val string : string -> representation
string s
is a representation of the strings
.
val int : int -> representation
int i
is a representation of the integeri
.
val int32 : int32 -> representation
int32 i
is a representation of the 32-bit integeri
.
val int64 : int64 -> representation
int64 i
is a representation of the 64-bit integeri
.
val nativeint : nativeint -> representation
nativeint i
is a representation of the native integeri
.
val float : float -> representation
float f
is a representation of the floating-point numberf
.
val char : char -> representation
char c
is a representation of the characterc
.
val bool : bool -> representation
bool b
is a representation of the Boolenan valueb
.
val option : ('a -> representation) -> 'a option -> representation
option f o
is a representation of the optiono
, where the representation of the element, if present, is computed by the functionf
.
val list : ('a -> representation) -> 'a list -> representation
list f xs
is a representation of the listxs
, where the representation of each element is computed by the functionf
.
val array : ('a -> representation) -> 'a array -> representation
array f xs
is a representation of the arrayxs
, where the representation of each element is computed by the functionf
.
val ref : ('a -> representation) -> 'a Stdlib.ref -> representation
ref r
is a representation of the referencer
, where the representation of the content is computed by the functionf
.
val unknown : type_name -> 'a -> representation
unknown t _
is a representation of an unknown value of typet
.