package ocaml-base-compiler

  1. Overview
  2. Docs
type position =
  1. | First
  2. | Second
val swap_position : position -> position
val print_pos : Format.formatter -> position -> unit
type desc = {
  1. t : Types.type_expr;
  2. expanded : Types.type_expr option;
}
type 'a diff = {
  1. got : 'a;
  2. expected : 'a;
}
val map_diff : ('a -> 'b) -> 'a diff -> 'b diff

map_diff f {expected;got} is {expected=f expected; got=f got}

type 'a escape_kind =
  1. | Constructor of Path.t
  2. | Univ of Types.type_expr
  3. | Self
  4. | Module_type of Path.t
  5. | Equation of 'a
  6. | Constraint

Scope escape related errors

type 'a escape = {
  1. kind : 'a escape_kind;
  2. context : Types.type_expr option;
}
val short : Types.type_expr -> desc
val explain : 'a list -> (prev:'a option -> 'a -> 'b option) -> 'b option
type unification = private
  1. | Unification
type comparison = private
  1. | Comparison
type fixed_row_case =
  1. | Cannot_be_closed
  2. | Cannot_add_tags of string list
type 'variety variant =
  1. | Incompatible_types_for : string -> _ variant
  2. | No_tags : position * (Asttypes.label * Types.row_field) list -> _ variant
  3. | No_intersection : unification variant
  4. | Fixed_row : position * fixed_row_case * Types.fixed_explanation -> unification variant
  5. | Openness : position -> comparison variant
type 'variety obj =
  1. | Missing_field : position * string -> _ obj
  2. | Abstract_row : position -> _ obj
  3. | Self_cannot_be_closed : unification obj
type ('a, 'variety) elt =
  1. | Diff : 'a diff -> ('a, _) elt
  2. | Variant : 'variety variant -> ('a, 'variety) elt
  3. | Obj : 'variety obj -> ('a, 'variety) elt
  4. | Escape : 'a escape -> ('a, _) elt
  5. | Incompatible_fields : {
    1. name : string;
    2. diff : Types.type_expr diff;
    } -> ('a, _) elt
  6. | Rec_occur : Types.type_expr * Types.type_expr -> ('a, _) elt
type 'variety t = (desc, 'variety) elt list
val diff : Types.type_expr -> Types.type_expr -> (desc, _) elt
val flatten : (Types.type_expr -> Types.type_expr -> 'a) -> 'variety t -> ('a, 'variety) elt list

flatten f trace flattens all elements of type desc in trace to either f x.t expanded if x.expanded=Some expanded or f x.t x.t otherwise

val map : ('a -> 'b) -> ('a, 'variety) elt list -> ('b, 'variety) elt list
val incompatible_fields : string -> Types.type_expr -> Types.type_expr -> (desc, _) elt
val swap_trace : 'variety t -> 'variety t
module Subtype : sig ... end
OCaml

Innovation. Community. Security.