Module Typerep_lib__Std_internal.Typerep

runtime type representations

type _ t =
| Int : int t
| Int32 : int32 t
| Int64 : int64 t
| Nativeint : nativeint t
| Char : char t
| Float : float t
| String : string t
| Bool : bool t
| Unit : unit t
| Option : 'a t ‑> 'a option t
| List : 'a t ‑> 'a list t
| Array : 'a t ‑> 'a array t
| Lazy : 'a t ‑> 'a lazy_t t
| Ref : 'a t ‑> 'a Pervasives.ref t
| Function : ('dom t * 'rng t) ‑> ('dom ‑> 'rng) t
| Tuple : 'a Typerep.Tuple.t ‑> 'a t
| Record : 'a Typerep.Record.t ‑> 'a t
| Variant : 'a Typerep.Variant.t ‑> 'a t

(** The Named constructor both allows for custom implementations of generics based on name and provides a way to represent recursive types, the lazy part dealing with cycles *)

| Named : ('a Typerep.Named.t * 'a t lazy_t option) ‑> 'a t
type packed =
| T : 'a t ‑> packed
module Named : sig ... end
module Tuple : sig ... end
include Typerep_lib.Variant_and_record_intf.S with type t := a t
type 'a t
include module type of sig ... end
module Tag_internal : sig ... end
module Tag : sig ... end

Witness of a tag, that is an item in a variant type, also called an "applied variant Constructor"

module Variant_internal : sig ... end
module Variant : sig ... end
module Field_internal : sig ... end
module Field : sig ... end
module Record_internal : sig ... end
module Record : sig ... end
val same : _ t ‑> _ t ‑> bool
val same_witness : 'a t ‑> 'b t ‑> ('a'bTyperep_lib.Type_equal.t option
val same_witness_exn : 'a t ‑> 'b t ‑> ('a'bTyperep_lib.Type_equal.t
val typename_of_t : 'a t ‑> 'a Typerep_lib.Typename.t
val head : 'a t ‑> 'a t

head ty is used to traverse the Named constructor. It might be used when one care to pattern match directly on the representation in a low level way rather than going through a full generic. head t is t if t is not of the form Named _