Gist.AbstractAbstract type representations.
module Version : sig ... endVersioned representations.
make versions is an abstract type with public representations versions.The zero-based version_index function attributes versions from the versions list to values (default to Fun.const (List.length versions - 1)).
val is_opaque : 'a t -> boolis_opaque a is true if and only if no representations are exposed by a. This means that Iarray.length (versions a) = 0.
versions a is the list of public representations of a (if any).
Warning. In general versions may be partial views over values of type v. So generic processors should not assume that any version can deal with a given v, version a v will though.
val version_index : 'a t -> 'a -> intversion_index a v is the index of the version attributed to v in the array versions a.
val find_version : Version.name -> 'a t -> 'a Version.t optionfind_version n a is the version named n of a if any.
check_non_opaque g a assumes a is g's expressions and raises Invalid_argument _ with an error message that mentions g's name if a is opaque.
compatible_value g a i0 i1 raises Invalid_argument _ with an error message that mentions g's name if version_index a v0 <> version_index a i1 or returns the version index otherwise. This is to check that a binary operation on two values v0 and v1 is using the same version.
get_gist g a v gets the gist for value v. This uses check_non_opaque before using version and Version.gist.
get_binop_gist g a v0 v1 gets a gist for a binary operation. This uses both check_non_opaque and check_compatible_version_index to return the gist of the version that v0 and v1 share.