Shared_ast.Type
type t = Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos
val format : Stdlib.Format.formatter -> t -> unit
module Map : Catala_utils.Map.S with type key = t
val hash : strip:Catala_utils.Uid.Path.t -> t -> Catala_utils.Hash.t
The strip
argument strips the given leading path components in included identifiers before hashing
val has_arrow : Shared_ast__.Definitions.decl_ctx -> t -> bool
Fails (with Invalid_argument
) on TForAll and TClosureEnv
Handling of variables
module Var : sig ... end
val free_vars : t -> Var.Set.t
val free_vars_pos : t -> Catala_utils.Pos.t Var.Map.t
Only the first position where the variable appeared is kept
Removes the outermost quantifiers from the given type, if any. The returned type is guaranteed to not have the form TForAll _
and may contain free variables
Recursively unbinds nested quantifiers and merges their variables (this is similar to unquantify
, but also returns the bound variables)
val forall : Var.t list -> t Bindlib.box -> Catala_utils.Pos.t -> t
The opposite of unbind
: constructs a TForAll
quantified type
val fresh_var : Catala_utils.Pos.t -> t
val any : Catala_utils.Pos.t -> t
deprecated, TODO replace with fresh_var
val universal : Catala_utils.Pos.t -> t
val is_universal : t -> bool