Module Bi_io
type node_tag = int
val bool_tag : node_tag
Tag indicating a bool node.
val int8_tag : node_tag
Tag indicating an int8 node.
val int16_tag : node_tag
Tag indicating an int16 node.
val int32_tag : node_tag
Tag indicating an int32 node.
val int64_tag : node_tag
Tag indicating an int64 node.
val float32_tag : node_tag
Tag indicating a float32 node.
val float64_tag : node_tag
Tag indicating a float64 node.
val uvint_tag : node_tag
Tag indicating a uvint node.
val svint_tag : node_tag
Tag indicating an svint node.
val string_tag : node_tag
Tag indicating a string node.
val array_tag : node_tag
Tag indicating an array node.
val tuple_tag : node_tag
Tag indicating a tuple node.
val record_tag : node_tag
Tag indicating a record node.
val num_variant_tag : node_tag
Tag indicating a num_variant node.
val variant_tag : node_tag
Tag indicating a variant node.
val unit_tag : node_tag
Tag indicating a unit node.
val table_tag : node_tag
Tag indicating a table node.
type hash = int
31-bit hash
val hash_name : string -> hash
Hash function used to compute field name tags and variant tags from
their full name.
val string_of_hashtag : hash -> bool -> string
Same as
write_hashtag
but writes to a string.
val make_unhash : string list -> hash -> string option
Compute the hash of each string of the input list
and return a function that converts a hash back
to the original string. Lookups do not allocate memory blocks.
Raises
Failure
if the input list contains two different strings
with the same hash.
type int7 = int
7-bit int used to represent a num_variant tag.
type tree = TODO: a
Tree representing serialized data, useful for testing
and for untyped transformations.
val string_of_tree : tree -> string
Serialization of a tree into a string.
val tree_of_string : ?unhash:hash -> string option -> string -> tree
Deserialization of a tree from a string.
val tag_of_tree : tree -> node_tag
Returns the node tag of the given tree.
val view_of_tree : tree -> string
val view : ?unhash:hash -> string option -> string -> string
Prints a human-readable representation of the data into a string.
val print_view_of_tree : tree -> unit
val print_view : ?unhash:hash -> string option -> string -> unit
Prints a human-readable representation of the data to stdout.
val output_view : ?unhash:hash -> string option -> Pervasives.out_channel -> string -> unit
Prints a human-readable representation of the data to an out_channel.
val safety_test : unit -> unit
Check that certain low-level hacks work as expected