package dolmen_type

  1. Overview
  2. Docs
type t

The type of types.

val print : Stdlib.Format.formatter -> t -> unit

Printing function.

exception Prenex_polymorphism of t

Raised when the type provided is polymorphic, but occurred in a place where polymorphic types are forbidden by prenex/rank-1 polymorphism.

module Var : sig ... end

A module for variables that occur in types.

module Const : sig ... end

A module for constant symbols the occur in types.

val equal : t -> t -> bool

Test equality of types.

val prop : t

The type of propositions

val of_var : Var.t -> t

Create a type from a variable.

val apply : Const.t -> t list -> t

Application for types.

val arrow : t list -> t -> t

Create an arrow type.

val pi : Var.t list -> t -> t

Create a polymorphic type.

val fv : t -> Var.t list

Returns the list of free_variables in the type.

val set_wildcard : Var.t -> t -> unit

Set a wildcard.

val add_wildcard_hook : hook:(Var.t -> t -> unit) -> Var.t -> unit

Add a hook to a wildcard, the hook will be run

val set_tag : t -> 'a Tag.t -> 'a -> unit

Annotate the given type with the given tag and value.

val add_tag : t -> 'a list Tag.t -> 'a -> unit

Add a value to the list of values bound to a tag.

type view = private [>
  1. | `Wildcard of Var.t
  2. | `Arrow of t list * t
  3. | `Pi of Var.t list * t
]

Partial views for types.

val view : t -> view

Partial view of a type.

OCaml

Innovation. Community. Security.