package fsml

  1. Overview
  2. Docs

Types

type t =
  1. | TyInt of sign attr * size attr * range attr
  2. | TyBool
  3. | TyArrow of t * t
    (*

    Internal use only

    *)
  4. | TyProduct of t list
    (*

    Internal use only

    *)
  5. | TyVar of t var
    (*

    Internal use only

    *)
and 'a attr =
  1. | Const of 'a
  2. | Var of 'a attr var
and 'a var = {
  1. stamp : string;
  2. mutable value : 'a value;
}
and 'a value =
  1. | Unknown
  2. | Known of 'a
and sign =
  1. | Signed
  2. | Unsigned
and size = int
and range = {
  1. lo : int;
  2. hi : int;
}
val pp : Ppx_deriving_runtime.Format.formatter -> t -> Ppx_deriving_runtime.unit
val show : t -> Ppx_deriving_runtime.string
val pp_attr : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> Ppx_deriving_runtime.Format.formatter -> 'a attr -> Ppx_deriving_runtime.unit
val show_attr : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> 'a attr -> Ppx_deriving_runtime.string
val pp_var : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> Ppx_deriving_runtime.Format.formatter -> 'a var -> Ppx_deriving_runtime.unit
val show_var : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> 'a var -> Ppx_deriving_runtime.string
val pp_value : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> Ppx_deriving_runtime.Format.formatter -> 'a value -> Ppx_deriving_runtime.unit
val show_value : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> 'a value -> Ppx_deriving_runtime.string
val pp_sign : Ppx_deriving_runtime.Format.formatter -> sign -> Ppx_deriving_runtime.unit
val show_sign : sign -> Ppx_deriving_runtime.string
val pp_size : Ppx_deriving_runtime.Format.formatter -> size -> Ppx_deriving_runtime.unit
val show_size : size -> Ppx_deriving_runtime.string
val pp_range : Ppx_deriving_runtime.Format.formatter -> range -> Ppx_deriving_runtime.unit
val show_range : range -> Ppx_deriving_runtime.string
val to_yojson : t -> Yojson.Safe.t
val attr_to_yojson : ('a -> Yojson.Safe.t) -> 'a attr -> Yojson.Safe.t
val var_to_yojson : ('a -> Yojson.Safe.t) -> 'a var -> Yojson.Safe.t
val value_to_yojson : ('a -> Yojson.Safe.t) -> 'a value -> Yojson.Safe.t
val sign_to_yojson : sign -> Yojson.Safe.t
val size_to_yojson : size -> Yojson.Safe.t
val range_to_yojson : range -> Yojson.Safe.t
type typ_scheme = {
  1. ts_params : ts_params;
  2. ts_body : t;
}
and ts_params = {
  1. tp_typ : t var list;
  2. tp_sign : sign attr var list;
  3. tp_size : size attr var list;
  4. tp_range : range attr var list;
}
val pp_typ_scheme : Ppx_deriving_runtime.Format.formatter -> typ_scheme -> Ppx_deriving_runtime.unit
val show_typ_scheme : typ_scheme -> Ppx_deriving_runtime.string
val pp_ts_params : Ppx_deriving_runtime.Format.formatter -> ts_params -> Ppx_deriving_runtime.unit
val show_ts_params : ts_params -> Ppx_deriving_runtime.string
val typ_scheme_to_yojson : typ_scheme -> Yojson.Safe.t
val ts_params_to_yojson : ts_params -> Yojson.Safe.t

Builders

val new_type_var : unit -> t var

new_type_var () returns a fresh type variable

val new_attr_var : unit -> 'a attr var

new_attr_var () returns a fresh type attribute variable

val type_int : unit -> t
val trivial_scheme : t -> typ_scheme

Unification

exception TypeConflict of t * t
exception TypeCircularity of t * t
val unify : t -> t -> unit
val type_instance : typ_scheme -> t
val real_type : t -> t
val real_attr : 'a attr -> 'a attr
exception Polymorphic of t
val mono_type : t -> t

Remove all type variables from type representation t. Raises !Polymorphic if t contains unresolved type variables.

Printing

val to_string : t -> string
OCaml

Innovation. Community. Security.