package gospel

  1. Overview
  2. Docs
module Ident = Identifier.Ident

type variables

type tvsymbol = {
  1. tv_name : Ident.t;
}
val tv_equal : tvsymbol -> tvsymbol -> bool
module Tvar : sig ... end
module Htv : sig ... end
module Mtv : sig ... end
val create_tv : Ident.t -> tvsymbol
val fresh_tv : ?loc:Ppxlib.Location.t -> string -> tvsymbol
val tv_of_string : ?loc:Ppxlib.Location.t -> string -> tvsymbol

types

type ty = {
  1. ty_node : ty_node;
}
and ty_node =
  1. | Tyvar of tvsymbol
  2. | Tyapp of tysymbol * ty list
and tysymbol = {
  1. ts_ident : Ident.t;
  2. ts_args : tvsymbol list;
  3. ts_alias : ty option;
}
val ts_equal : tysymbol -> tysymbol -> bool
val ty_equal : ty -> ty -> bool
module Ts : sig ... end
module Mts : sig ... end
val ts : Ident.t -> tvsymbol list -> tysymbol
val mk_ts : Ident.t -> tvsymbol list -> ty option -> tysymbol
val ts_ident : tysymbol -> Ident.t
val ts_args : tysymbol -> tvsymbol list
val ts_alias : tysymbol -> ty option
val ts_arity : tysymbol -> int
val fresh_ty_var : ?loc:Ppxlib.Location.t -> string -> ty
val ty_of_var : tvsymbol -> ty

smart constructors & utils

exception BadTypeArity of tysymbol * int
val ty_full_inst : ty Mtv.t -> ty -> ty
val ts_match_args : tysymbol -> 'a list -> 'b Mtv.t
val ty_app : tysymbol -> ty list -> ty
val ts_subst_ts : tysymbol -> tysymbol -> tysymbol -> tysymbol
val ty_subst_ts : tysymbol -> tysymbol -> ty -> ty
val ty_subst_ty : tysymbol -> tysymbol -> ty -> ty -> ty
val ts_subst_ty : tysymbol -> tysymbol -> ty -> tysymbol -> tysymbol

type matching

exception TypeMismatch of ty * ty
val ty_match : ty Mtv.t -> ty -> ty -> ty Mtv.t
val ty_equal_check : ty -> ty -> unit

Built-in symbols

val ts_unit : tysymbol
val ts_integer : tysymbol
val ts_bool : tysymbol
val ts_float : tysymbol
val ts_char : tysymbol
val ts_string : tysymbol
val ts_option : tysymbol
val ts_list : tysymbol
val ts_tuple : int -> tysymbol
val ts_arrow : tysymbol
val is_ts_tuple : tysymbol -> bool
val is_ts_arrow : tysymbol -> bool
val ty_unit : ty
val ty_integer : ty
val ty_bool : ty
val ty_float : ty
val ty_char : ty
val ty_string : ty
val ty_option : ty -> ty
val ty_list : ty -> ty
val ty_tuple : ty list -> ty
type exn_type =
  1. | Exn_tuple of ty list
  2. | Exn_record of (Ident.t * ty) list
type xsymbol = {
  1. xs_ident : Ident.t;
  2. xs_type : exn_type;
}
val xsymbol : Ident.t -> exn_type -> xsymbol
val xs_equal : xsymbol -> xsymbol -> bool
module Xs : sig ... end
module Mxs : sig ... end
val xs_subst_ts : tysymbol -> tysymbol -> xsymbol -> xsymbol
val xs_subst_ty : tysymbol -> tysymbol -> ty -> xsymbol -> xsymbol

Pretty printers

val print_tv : Format.formatter -> tvsymbol -> unit
val print_ts_name : Format.formatter -> tysymbol -> unit
val print_ty : ty Utils.Fmt.t
val print_arrow_ty : Format.formatter -> ty list -> unit
val print_ty_node : Format.formatter -> ty_node -> unit
val print_ts : Format.formatter -> tysymbol -> unit
val print_exn_type : Format.formatter -> exn_type -> unit
val print_xs : Format.formatter -> xsymbol -> unit
OCaml

Innovation. Community. Security.