Up

Module Typerep

runtime type representations

Signature

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 'a t := 'a t
type 'a t
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
ERROR: std_internal.mli:143:7-143:8
6:7-6:8 :
text expected
val same_witness : 'a t -> 'b t -> ('a, 'b) Typerep_lib.Type_equal.t option
val same_witness_exn : 'a t -> 'b t -> ('a, 'b) Typerep_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 _