Llair.TypTypes
type t = private | Function of {}(Global) function names have type Pointer to Function.
*)| Integer of {}Integer of given bitwidth.
*)| Float of {}Floating-point numbers of given bitwidth and encoding.
*)| Pointer of {elt : t;}Pointer to element type.
*)| Array of {elt : t;len : int;bits : int;byts : int;}Statically-sized array of len elements of type elt.
| Tuple of {}Anonymous aggregate of heterogeneous types.
*)| Struct of {}Uniquely named aggregate of heterogeneous types. Elements are specified by their byte offset and their type. Every cycle of recursive types contains a Struct. NOTE: recursive Struct types are represented by cyclic values.
| Opaque of {}Uniquely named aggregate type whose definition is hidden.
*)include Ppx_compare_lib.Comparable.S with type t := tval compare : t Base__Ppx_compare_lib.compareinclude Ppx_compare_lib.Equal.S with type t := tval equal : t Base__Ppx_compare_lib.equalinclude NS.Invariant.S with type t := tval invariant : t -> unitConstructors
val bool : tval byt : tval int : tval siz : tval ptr : tval integer : bits:int -> byts:int -> tval float :
bits:int ->
byts:int ->
enc:[ `Brain | `Extended | `IEEE | `Pair ] ->
tval opaque : name:string -> tQueries
val is_sized : t -> boolHolds of types which are first-class and have a statically-known size.
val is_int : t -> boolval bit_size_of : t -> intThe number of bits required to hold a value of the given type. Raises unless is_sized holds.
val size_of : t -> intThe number of bytes between adjacent values of the given type, including alignment padding. Raises unless is_sized holds.
val offset_length_of_elt : t -> int -> int * intThe offset in bytes to, and number of bytes occupied by, the given element of an aggretage type. Raises if type is not an aggregate or index is invalid.
Equivalent types are those that denote the same sets of values in the semantic model. An equivalence relation.
Castable types are those that can be cast between without loss of information. An equivalence relation.
Convertible types are those that can be converted between, perhaps with some loss of information. Not transitive: some admissible conversions must be performed in multiple steps, such as from Pointer to Integer to Array.
compatible_fnptr t t' holds when (1) both t and t' are pointer types with function element type, and (2) t's function type can be applied at a call site with t''s function type, in that they have the same arity and convertible formal argument/return types.
module Tbl : NS.HashTable.S with type key = tMutable hash tables keyed on types