Module Flambda2_bound_identifiers.Bound_pattern
Things that a Let-expression binds. If a Let-expression binds more than one name, all of those names have the same kind.
type t = private | Singleton of Flambda2_bound_identifiers.Bound_var.t(*The binding of a single variable, which is statically scoped. This case is not used for sets of closures.
*)| Set_of_closures of Flambda2_bound_identifiers.Bound_var.t list(*The binding of one or more variables to the individual closures in a set of closures. The variables are statically scoped.
*)| Static of Flambda2_bound_identifiers.Bound_static.t(*The binding of symbols and code IDs to statically-allocated constants and pieces of code. The scoping of the symbols and code IDs follows the dominator tree, not syntactic scope.
*)
val singleton :
Flambda2_bound_identifiers.Bound_var.t ->
Flambda2_bound_identifiers.Bound_pattern.tval set_of_closures :
Flambda2_bound_identifiers.Bound_var.t list ->
Flambda2_bound_identifiers.Bound_pattern.tval must_be_singleton :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_bound_identifiers.Bound_var.tval must_be_singleton_opt :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_bound_identifiers.Bound_var.t optionval must_be_set_of_closures :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_bound_identifiers.Bound_var.t listval must_be_static :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_bound_identifiers.Bound_static.tval name_mode :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_nominal.Name_mode.tval with_name_mode :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_nominal.Name_mode.t ->
Flambda2_bound_identifiers.Bound_pattern.tval exists_all_bound_vars :
Flambda2_bound_identifiers.Bound_pattern.t ->
f:(Flambda2_bound_identifiers.Bound_var.t -> bool) ->
boolval fold_all_bound_vars :
Flambda2_bound_identifiers.Bound_pattern.t ->
init:'a ->
f:('a -> Flambda2_bound_identifiers.Bound_var.t -> 'a) ->
'aval fold_all_bound_names :
Flambda2_bound_identifiers.Bound_pattern.t ->
init:'a ->
var:('a -> Flambda2_bound_identifiers.Bound_var.t -> 'a) ->
symbol:('a -> Flambda2_identifiers.Symbol.t -> 'a) ->
code_id:('a -> Flambda2_identifiers.Code_id.t -> 'a) ->
'ainclude Flambda2_nominal.Bindable.S
with type t := Flambda2_bound_identifiers.Bound_pattern.t
include Flambda2_nominal.Contains_names.S
with type t := Flambda2_bound_identifiers.Bound_pattern.t
val free_names :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_nominal.Name_occurrences.tCompute the free names of a term. Such computation covers all kinds of bindable names (variables, continuations, ...)
val apply_renaming :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_nominal.Renaming.t ->
Flambda2_bound_identifiers.Bound_pattern.tApply a renaming throughout a term.
include Flambda2_nominal.Contains_ids.S
with type t := Flambda2_bound_identifiers.Bound_pattern.t
val ids_for_export :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_nominal.Ids_for_export.tGather all table identifiers to export them.
val print :
Stdlib.Format.formatter ->
Flambda2_bound_identifiers.Bound_pattern.t ->
unitval rename :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_bound_identifiers.Bound_pattern.tFreshen the given name.
val is_renamed_version_of :
Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_bound_identifiers.Bound_pattern.t ->
boolEquivalence relation on renamed variables.
is_renamed_version_of x y is true if there exists a bindable z such that x and y are renamed versions of z.
Note: this function can return true in other cases (if there are some name collisions for instance), this is (at least currently) only used for a sanity check, so users should not rely too much on its expected semantics.
val renaming :
Flambda2_bound_identifiers.Bound_pattern.t ->
guaranteed_fresh:Flambda2_bound_identifiers.Bound_pattern.t ->
Flambda2_nominal.Renaming.trenaming stale ~guaranteed_fresh:fresh is to create a renaming that turns all occurrences of the name stale into fresh (in a capture-avoiding manner, but that is inherent in Renaming).