package typerep_extended

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
exception Not_downgradable of Core_kernel.Sexp.t

Exception raised when trying to downgrade a type struct that makes use of new features or info not representable in a former version.

include sig ... end
module Name : sig ... end
module Variant : sig ... end
module Variant_infos : sig ... end
module Field : sig ... end
module Record_infos : sig ... end
type t =
  1. | Int
  2. | Int32
  3. | Int64
  4. | Nativeint
  5. | Char
  6. | Float
  7. | String
  8. | Bool
  9. | Unit
  10. | Option of t
  11. | List of t
  12. | Array of t
  13. | Lazy of t
  14. | Ref of t
  15. | Tuple of t Farray.t
  16. | Record of Record_infos.t * (Field.t * t) Farray.t
  17. | Variant of Variant_infos.t * (Variant.t * t Farray.t) Farray.t
  18. | Named of Name.t * t option
include sig ... end
val sexp_of_t : t -> Sexplib.Sexp.t
type type_struct = t
val get_variant_by_repr : Variant_infos.t -> (Variant.t * t Farray.t) Farray.t -> int -> (Variant.t * t Farray.t) option
val get_variant_by_label : Variant_infos.t -> (Variant.t * t Farray.t) Farray.t -> string -> (Variant.t * t Farray.t) option
val variant_args_of_type_struct : arity:int -> t -> t Farray.t
val type_struct_of_variant_args : t Farray.t -> t
val option_as_variant : some:t -> Variant_infos.t * (Variant.t * t Farray.t) Farray.t
val incompatible : unit -> t
val alpha_conversion : t -> t
val has_named : t -> bool
val standalone_exn : readonly:t Name.Table.t -> t -> t

re put at least one Named let binding for each named used in the structure so that the structure is self contained, and not depend on table anymore. This is needed especially if the structure has to go outside and be given to some other part of the world

val reduce : t -> t
val are_equivalent : t -> t -> bool

This compare is insensible to alpha conversion of cycle indexes, as well as reduction. The polymorphic compare may be wrong for equivalent structures. See also alpha_conversion or reduce if needed.

This function considers equivalent polymorphic variants with different order of fields, as long as the order of cases is the only difference.

val least_upper_bound_exn : t -> t -> t

merge two types by regrouping the polymorphic variants, if this can be done. if this cannot be done, this raises with a reason for the error, in the hope that this information could be seen by an human, like a compiler type error message.

val is_polymorphic_variant : t -> bool
module type Typestructable = sig ... end
module Generic : Typerep_lib.Std.Type_generic.S with type 'a t = t
val of_typerep : 'a Typerep_lib.Std.Typerep.t -> t
val to_typerep : t -> Typerep_lib.Std.Typerep.packed

This generates new uniq Names for the type present in the structure. In particular, behavior overrides done via the generic registering mechanism will not occur when working out of the returned type_rep.

module Diff : sig ... end

Diff offers a way to know given two type structures if their bin_io representation would be compatible. If not, the difference between the structure is computed and can be given as part as an error message.

module Versioned : sig ... end
class traverse : object ... end
module Named_utils (X : sig ... end) : sig ... end
type 'a typed_t = t
val recreate_dynamically_typerep_for_test : 'a Typerep_lib.Std.Typerep.t -> 'a Typerep_lib.Std.Typerep.t