package gospel

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

type variables

type tvsymbol = {
  1. tv_name : Ident.t;
}
val pp_tvsymbol : Ppx_deriving_runtime.Format.formatter -> tvsymbol -> Ppx_deriving_runtime.unit
val show_tvsymbol : tvsymbol -> Ppx_deriving_runtime.string
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 pp_ty : Ppx_deriving_runtime.Format.formatter -> ty -> Ppx_deriving_runtime.unit
val pp_ty_node : Ppx_deriving_runtime.Format.formatter -> ty_node -> Ppx_deriving_runtime.unit
val show_ty_node : ty_node -> Ppx_deriving_runtime.string
val pp_tysymbol : Ppx_deriving_runtime.Format.formatter -> tysymbol -> Ppx_deriving_runtime.unit
val show_tysymbol : tysymbol -> Ppx_deriving_runtime.string
val ts_equal : tysymbol -> tysymbol -> bool
val ty_equal : ty -> ty -> bool
module Ts : sig ... end
module Mts : sig ... end
module Hts : 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

val ty_full_inst : ?loc:Ppxlib.Location.t -> ty Mtv.t -> ty -> ty
val ts_match_args : ?loc:Ppxlib.Location.t -> tysymbol -> 'a list -> 'a Mtv.t
val ty_app : ?loc:Ppxlib.Location.t -> 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_int : tysymbol
val ts_char : tysymbol
val ts_bytes : tysymbol
val ts_string : tysymbol
val ts_float : tysymbol
val ts_bool : tysymbol
val ts_exn : tysymbol
val ts_array : tysymbol
val ts_list : tysymbol
val ts_option : tysymbol
val ts_int32 : tysymbol
val ts_int64 : tysymbol
val ts_nativeint : tysymbol
val ts_format6 : tysymbol
val ts_lazy : 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_int : 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
val pp_exn_type : Ppx_deriving_runtime.Format.formatter -> exn_type -> Ppx_deriving_runtime.unit
val show_exn_type : exn_type -> Ppx_deriving_runtime.string
type xsymbol = {
  1. xs_ident : Ident.t;
  2. xs_type : exn_type;
}
val pp_xsymbol : Ppx_deriving_runtime.Format.formatter -> xsymbol -> Ppx_deriving_runtime.unit
val show_xsymbol : xsymbol -> Ppx_deriving_runtime.string
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 : Stdlib.Format.formatter -> tvsymbol -> unit
val print_ts_name : Stdlib.Format.formatter -> tysymbol -> unit
val print_ty : ty Utils.Fmt.t
val print_arrow_ty : Stdlib.Format.formatter -> ty list -> unit
val print_ty_node : Stdlib.Format.formatter -> ty_node -> unit
val print_ts : Stdlib.Format.formatter -> tysymbol -> unit
val print_exn_type : Stdlib.Format.formatter -> exn_type -> unit
val print_xs : Stdlib.Format.formatter -> xsymbol -> unit
OCaml

Innovation. Community. Security.