package fsml

  1. Overview
  2. Docs

Module Fsml.TypesSource

Types

Sourcetype 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

    *)
Sourceand 'a attr =
  1. | Const of 'a
  2. | Var of 'a attr var
Sourceand 'a var = {
  1. stamp : string;
  2. mutable value : 'a value;
}
Sourceand 'a value =
  1. | Unknown
  2. | Known of 'a
Sourceand sign =
  1. | Signed
  2. | Unsigned
Sourceand size = int
Sourceand range = {
  1. lo : int;
  2. hi : int;
}
Sourceval to_yojson : t -> Yojson.Safe.t
Sourceval attr_to_yojson : ('a -> Yojson.Safe.t) -> 'a attr -> Yojson.Safe.t
Sourceval var_to_yojson : ('a -> Yojson.Safe.t) -> 'a var -> Yojson.Safe.t
Sourceval value_to_yojson : ('a -> Yojson.Safe.t) -> 'a value -> Yojson.Safe.t
Sourceval sign_to_yojson : sign -> Yojson.Safe.t
Sourceval size_to_yojson : size -> Yojson.Safe.t
Sourceval range_to_yojson : range -> Yojson.Safe.t
Sourcetype typ_scheme = {
  1. ts_params : ts_params;
  2. ts_body : t;
}
Sourceand 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;
}
Sourceval typ_scheme_to_yojson : typ_scheme -> Yojson.Safe.t
Sourceval ts_params_to_yojson : ts_params -> Yojson.Safe.t

Builders

Sourceval new_type_var : unit -> t var

new_type_var () returns a fresh type variable

Sourceval new_attr_var : unit -> 'a attr var

new_attr_var () returns a fresh type attribute variable

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

Unification

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

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

Printing

Sourceval to_string : t -> string