jon.recoil.org

Module Flambda.Let_expr

The alpha-equivalence classes of expressions that bind variables; and the expressions that bind symbols and code IDs (which are not treated up to alpha equivalence).

Variables have normal syntactic scoping. Symbols and code IDs are treated as in scope in all parts of the term dominated by the corresponding Let-binding.

type t = let_expr
include Expr_std.S_no_free_names with type t := t
val print : Format.formatter -> t -> unit
val apply_renaming : t -> Flambda2_nominal.Renaming.t -> t
val defining_expr : t -> named

The defining expression of the Let.

val pattern_match : t -> f:(Flambda2_bound_identifiers.Bound_pattern.t -> body:expr -> 'a) -> 'a

Look inside the Let by choosing a member of the alpha-equivalence class.

val pattern_match' : t -> f: (Flambda2_bound_identifiers.Bound_pattern.t -> num_normal_occurrences_of_bound_vars: Flambda2_nominal.Num_occurrences.t Flambda2_identifiers.Variable.Map.t -> body:expr -> 'a) -> 'a
module Pattern_match_pair_error : sig ... end
val pattern_match_pair : t -> t -> dynamic: (Flambda2_bound_identifiers.Bound_pattern.t -> body1:expr -> body2:expr -> 'a) -> static: (bound_static1:Flambda2_bound_identifiers.Bound_static.t -> bound_static2:Flambda2_bound_identifiers.Bound_static.t -> body1:expr -> body2:expr -> 'a) -> ('a, Pattern_match_pair_error.t) Result.t

Look inside two Lets by choosing members of their alpha-equivalence classes, using the same bound variables for both. If they are both dynamic lets (that is, they both bind variables), this invokes dynamic having freshened both bodies; if they are both static (that is, they both bind symbols), this invokes static with the bodies unchanged, since no renaming is necessary.