Module Typechecker.Type

Manages the type definitions.

type row = [
  1. | `Closed
  2. | `Open
]
type int_bool =
  1. | Not_bool
  2. | Bool
type 'a sum = {
  1. mutable cases : 'a;
  2. mutable row : row;
}

Common fields shared by the enum and union types.

type ty =
  1. | Unknown of row Stdlib.ref
    (*

    The row is for unification with sum types during destructuring.

    *)
  2. | Int
  3. | Float
  4. | String
  5. | Nullable of t
  6. | List of t
  7. | Tuple of t list
  8. | Record of record
  9. | Dict of t * set_string Stdlib.ref
    (*

    The set tracks which keys have been used so they can build pattern-matching decision trees.

    *)
  10. | Enum_int of set_int sum * int_bool
  11. | Enum_string of set_string sum
  12. | Union_int of string * sum_union_int * int_bool
  13. | Union_string of string * sum_union_string
and sum_union_int = record map_int sum
and sum_union_string = record map_string sum
and record = t map_string Stdlib.ref
and t = ty Stdlib.ref
type interface = t map_string
val pp : Stdlib.Format.formatter -> t -> unit
val pp_interface : Stdlib.Format.formatter -> interface -> unit