Module Bin_prot.Shape
include Bin_shape_lib.Std.Shape
type tShape.tare constructed by thebin_shapesyntax extension from Ocaml type definitions & expressions.There is a direct mapping from ocaml type definition syntax to the corresponding
Shape.groupand from ocaml type expression syntax to the correspondingShape.t.
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
module Tid = Bin_shape_lib.Bin_shape.Tidmodule Vid = Bin_shape_lib.Bin_shape.Vidmodule Location = Bin_shape_lib.Bin_shape.LocationLocation.tis required when constructing shapes for which evaluation might fail.
module Uuid = Bin_shape_lib.Bin_shape.UuidUuid.tis used bybasetypeandannotate.
val group : Location.t -> (Tid.t * Vid.t list * t) list -> groupThis function is generative; repeated calls create distinct groups
val constr : string -> t option -> poly_variant_rowval inherit_ : Location.t -> t -> poly_variant_rowval poly_variant : Location.t -> poly_variant_row list -> tval rec_app : Tid.t -> t list -> trecursive apps within the current group
val var : Location.t -> Vid.t -> tval basetype : Uuid.t -> t list -> tBuilt-in types and types with custom serialization: i.e. int,list,... To avoid accidental protocol compatibility, pass a UUID as the
stringargument
module Digest = Bin_shape_lib.Bin_shape.Digestmodule Canonical = Bin_shape_lib.Bin_shape.Canonicalval eval : t -> Canonical.teval treturns the canonical-shape for a shape-expressionShape.t. Type aliases are expanded, so that noTid.torVid.thave significance in the resulting canonical-shape. Type-recursion, including non-regular recursion, is translated to the de-bruijn representation used in canonical-shapes.
val eval_to_digest : t -> Digest.teval_to_digest treturns a hash-value direct from theShape.t, potentially avoiding the intermediateCanonical.tfrom being constructed. This is important as the size of a canonical-shape might be exponential in terms of the size of the shape expression. The following holds:Digest.(eval_to_digest exp = Canonical.to_digest (eval exp))
val eval_to_digest_string : t -> stringeval_to_digest_string t==Digest.to_hex (eval_to_digest t)Convenience function useful for writing unit tests.
module For_typerep = Bin_shape_lib.Bin_shape.For_typerepval bin_shape_unit : tval bin_shape_bool : tval bin_shape_string : tval bin_shape_bytes : tval bin_shape_char : tval bin_shape_float : tval bin_shape_int : tval bin_shape_int32 : tval bin_shape_int63 : tval bin_shape_int64 : tval bin_shape_nativeint : tval bin_shape_nat0 : tval bin_shape_digest : tval bin_shape_float32_vec : tval bin_shape_float64_vec : tval bin_shape_vec : tval bin_shape_float32_mat : tval bin_shape_float64_mat : tval bin_shape_mat : tval bin_shape_bigstring : tval bin_shape_variant_int : tval bin_shape_int_8bit : tval bin_shape_int_16bit : tval bin_shape_int_32bit : tval bin_shape_int_64bit : tval bin_shape_int64_bits : tval bin_shape_network16_int : tval bin_shape_network32_int : tval bin_shape_network32_int32 : tval bin_shape_network64_int : tval bin_shape_network64_int64 : tval bin_shape_ref : t -> tval bin_shape_option : t -> tval bin_shape_list : t -> tval bin_shape_array : t -> tval bin_shape_hashtbl : t -> t -> tval bin_shape_float_array : tval bin_shape_lazy : 'a -> 'aval bin_shape_pair : t -> t -> tval bin_shape_triple : t -> t -> t -> t