package links

  1. Overview
  2. Docs

Core types

type 'a stringmap = 'a Utility.StringMap.t
type 'a field_env = 'a stringmap
module TypeVarSet : sig ... end
type 'a point = 'a Unionfind.point
type 't meta_type_var_non_rec_basis = [
  1. | `Var of int * CommonTypes.Subkind.t * CommonTypes.Freedom.t
  2. | `Body of 't
]
type 't meta_type_var_basis = [
  1. | 't meta_type_var_non_rec_basis
  2. | `Recursive of int * 't
]
type 't meta_row_var_basis = [
  1. | 't meta_type_var_basis
  2. | `Closed
]
type 't meta_presence_var_basis = 't meta_type_var_non_rec_basis
type 't meta_max_basis = 't meta_row_var_basis
module Abstype : sig ... end
module Vars : sig ... end
module Print : sig ... end
val process : Abstype.t
val list : Abstype.t
val event : Abstype.t
val dom_node : Abstype.t
val access_point : Abstype.t
val socket : Abstype.t
val spawn_location : Abstype.t
type ('t, 'r) session_type_basis = [
  1. | `Input of 't * 't
  2. | `Output of 't * 't
  3. | `Select of 'r
  4. | `Choice of 'r
  5. | `Dual of 't
  6. | `End
]
type rec_id =
  1. | MuBoundId of int
  2. | NominalId of string
val show_rec_id : rec_id -> Ppx_deriving_runtime.string
module type RECIDMAP = Utility.Map with type key = rec_id
module type RECIDSET = Utility.Set with type elt = rec_id
type tygroup = {
  1. id : int;
  2. type_map : (CommonTypes.Quantifier.t list * typ) Utility.StringMap.t;
  3. linearity_map : bool Utility.StringMap.t;
}
and rec_appl = {
  1. r_name : string;
  2. r_dual : bool;
  3. r_unique_name : string;
  4. r_quantifiers : CommonTypes.Kind.t list;
  5. r_args : type_arg list;
  6. r_unwind : type_arg list -> bool -> typ;
  7. r_linear : unit -> bool option;
}
and typ = [
  1. | `Not_typed
  2. | `Primitive of CommonTypes.Primitive.t
  3. | `Function of typ * row * typ
  4. | `Lolli of typ * row * typ
  5. | `Record of row
  6. | `Variant of row
  7. | `Effect of row
  8. | `Table of typ * typ * typ
  9. | `Lens of Links_core.Lens.Type.t
  10. | `Alias of (string * CommonTypes.Kind.t list * type_arg list) * typ
  11. | `Application of Abstype.t * type_arg list
  12. | `RecursiveApplication of rec_appl
  13. | `MetaTypeVar of meta_type_var
  14. | `ForAll of CommonTypes.Quantifier.t list * typ
  15. | (typ, row) session_type_basis
]
and field_spec = [
  1. | `Present of typ
  2. | `Absent
  3. | `Var of meta_presence_var
]
and field_spec_map = field_spec field_env
and row_var = meta_row_var
and row = field_spec_map * row_var * bool
and meta_type_var = typ meta_type_var_basis point
and meta_row_var = row meta_row_var_basis point
and meta_presence_var = field_spec meta_presence_var_basis point
and meta_var = [
  1. | `Type of meta_type_var
  2. | `Row of meta_row_var
  3. | `Presence of meta_presence_var
]
and type_arg = [
  1. | `Type of typ
  2. | `Row of row
  3. | `Presence of field_spec
]
val show_tygroup : tygroup -> Ppx_deriving_runtime.string
val show_rec_appl : rec_appl -> Ppx_deriving_runtime.string
val show_field_spec : field_spec -> Ppx_deriving_runtime.string
val show_field_spec_map : field_spec_map -> Ppx_deriving_runtime.string
val show_row_var : row_var -> Ppx_deriving_runtime.string
val show_meta_type_var : meta_type_var -> Ppx_deriving_runtime.string
val show_meta_row_var : meta_row_var -> Ppx_deriving_runtime.string
val show_meta_presence_var : meta_presence_var -> Ppx_deriving_runtime.string
val show_meta_var : meta_var -> Ppx_deriving_runtime.string
val show_type_arg : type_arg -> Ppx_deriving_runtime.string
type session_type = (typ, row) session_type_basis
type datatype = typ
module type Constraint = sig ... end

A constraint that a subkind imposes on types.

module Base : Constraint
module Unl : Constraint
module Mono : Constraint
val get_restriction_constraint : CommonTypes.Restriction.t -> (module Constraint) option

Get a Constraint for a specific subkind Restriction.t.

val dual_row : row -> row
val dual_type : datatype -> datatype
type alias_type = CommonTypes.Quantifier.t list * typ
val show_alias_type : alias_type -> Ppx_deriving_runtime.string
type tycon_spec = [
  1. | `Alias of alias_type
  2. | `Abstract of Abstype.t
  3. | `Mutual of CommonTypes.Quantifier.t list * tygroup ref
]
type environment = datatype Env.String.t
type tycon_environment = tycon_spec Env.String.t
type typing_environment = {
  1. var_env : environment;
  2. rec_vars : Utility.StringSet.t;
  3. tycon_env : tycon_environment;
  4. effect_row : row;
  5. desugared : bool;
}
val empty_typing_environment : typing_environment
val concrete_type : datatype -> datatype
val concrete_field_spec : field_spec -> field_spec
val normalise_datatype : datatype -> datatype
val normalise_row : row -> row
val normalise_typing_environment : typing_environment -> typing_environment
val for_all : (CommonTypes.Quantifier.t list * datatype) -> datatype
val unit_type : datatype

useful types

val string_type : datatype
val keys_type : datatype
val char_type : datatype
val bool_type : datatype
val int_type : datatype
val float_type : datatype
val database_type : datatype
val xml_type : datatype
val empty_type : datatype
val free_type_vars : datatype -> TypeVarSet.t

get type variables

val free_row_type_vars : row -> TypeVarSet.t
val free_tyarg_vars : type_arg -> TypeVarSet.t
val free_bound_type_vars : typ -> Vars.vars_list
val free_bound_row_type_vars : row -> Vars.vars_list
val free_bound_type_arg_type_vars : type_arg -> Vars.vars_list
val type_arg_of_quantifier : CommonTypes.Quantifier.t -> type_arg
val quantifier_of_type_arg : type_arg -> CommonTypes.Quantifier.t
val quantifiers_of_type_args : type_arg list -> CommonTypes.Quantifier.t list
val primary_kind_of_type_arg : type_arg -> CommonTypes.PrimaryKind.t
val type_variable_counter : int ref

Fresh type variables

val fresh_raw_variable : unit -> int
val make_type_variable : int -> CommonTypes.Subkind.t -> datatype

type variable construction

val make_rigid_type_variable : int -> CommonTypes.Subkind.t -> datatype
val make_row_variable : int -> CommonTypes.Subkind.t -> row_var
val make_rigid_row_variable : int -> CommonTypes.Subkind.t -> row_var
val make_rigid_presence_variable : int -> CommonTypes.Subkind.t -> field_spec
val fresh_type_variable : CommonTypes.Subkind.t -> datatype

fresh type variable generation

val fresh_rigid_type_variable : CommonTypes.Subkind.t -> datatype
val fresh_row_variable : CommonTypes.Subkind.t -> row_var
val fresh_rigid_row_variable : CommonTypes.Subkind.t -> row_var
val fresh_session_variable : CommonTypes.Linearity.t -> datatype
val fresh_presence_variable : CommonTypes.Subkind.t -> field_spec
val fresh_rigid_presence_variable : CommonTypes.Subkind.t -> field_spec

fresh quantifiers

val fresh_row_quantifier : CommonTypes.Subkind.t -> CommonTypes.Quantifier.t * row
val fresh_presence_quantifier : CommonTypes.Subkind.t -> CommonTypes.Quantifier.t * field_spec
val make_empty_closed_row : unit -> row

empty row constructors

val make_empty_open_row : CommonTypes.Subkind.t -> row
val make_singleton_closed_row : (string * field_spec) -> row

singleton row constructors

val make_singleton_open_row : (string * field_spec) -> CommonTypes.Subkind.t -> row
val is_closed_row : row -> bool

row predicates

val is_absent_from_row : string -> row -> bool
val is_tuple : ?allow_onetuples:bool -> row -> bool
val get_row_var : row -> int option

row_var retrieval

val make_closed_row : datatype field_env -> row

building rows

val row_with : (string * field_spec) -> row -> row
val extend_row : datatype field_env -> row -> row
val extend_row_safe : datatype field_env -> row -> row option
val empty_field_env : field_spec_map

constants

val closed_row_var : row_var
val field_env_union : (field_spec_map * field_spec_map) -> field_spec_map
val is_canonical_row_var : row_var -> bool
val is_rigid_row : row -> bool
val is_rigid_row_with_var : int -> row -> bool
val is_flattened_row : row -> bool
val is_empty_row : row -> bool
val flatten_row : row -> row

Convert a row to the form (field_env, row_var) where row_var is of the form: `Closed | `Flexible var | `Rigid var | `Recursive

val unwrap_row : row -> row * row_var option

As flatten_row except if the flattened row_var is of the form:

`Recursive (var, rec_row)

then it is unwrapped. This ensures that all the fields are exposed in field_env.

Also returns the outermost `Recursive that was unwrapped if it exists, or None otherwise.

val unwrap_list_type : typ -> typ
val extract_tuple : row -> datatype list
val make_tuple_type : datatype list -> datatype

type constructors

val make_list_type : datatype -> datatype
val make_process_type : row -> datatype
val make_record_type : datatype field_env -> datatype
val make_variant_type : datatype field_env -> datatype
val make_table_type : (datatype * datatype * datatype) -> datatype
val make_endbang_type : datatype
val is_sub_type : (datatype * datatype) -> bool

subtyping

val is_sub_row : (row * row) -> bool
val extend_typing_environment : typing_environment -> typing_environment -> typing_environment
val effect_sugar : bool Settings.setting
val string_of_datatype : ?policy:(unit -> Print.policy) -> ?refresh_tyvar_names:bool -> datatype -> string

pretty printing

val string_of_row : ?policy:(unit -> Print.policy) -> ?refresh_tyvar_names:bool -> row -> string
val string_of_presence : ?policy:(unit -> Print.policy) -> ?refresh_tyvar_names:bool -> field_spec -> string
val string_of_type_arg : ?policy:(unit -> Print.policy) -> ?refresh_tyvar_names:bool -> type_arg -> string
val string_of_row_var : ?policy:(unit -> Print.policy) -> ?refresh_tyvar_names:bool -> row_var -> string
val string_of_tycon_spec : ?policy:(unit -> Print.policy) -> ?refresh_tyvar_names:bool -> tycon_spec -> string
val string_of_environment : environment -> string
val string_of_typing_environment : typing_environment -> string
val build_tyvar_names : refresh_tyvar_names:bool -> ('a -> Vars.vars_list) -> 'a list -> unit

generating type variable names

val add_tyvar_names : ('a -> Vars.vars_list) -> 'a list -> unit
val make_pure_function_type : datatype list -> datatype -> datatype
val make_function_type : ?linear:bool -> datatype list -> row -> datatype -> datatype
val make_thunk_type : row -> datatype -> datatype
val pp_datatype : Format.formatter -> datatype -> unit
val pp_tycon_spec : Format.formatter -> tycon_spec -> unit
module type TYPE_VISITOR = sig ... end
class virtual type_predicate : object ... end
OCaml

Innovation. Community. Security.