Module Stmt.Helpers

val temp_vars : Expr.Typed.t list -> Located.t list * Expr.Typed.t list * (unit -> unit)
val ensure_var : (Expr.Typed.t -> 'a -> Located.t) -> Expr.Typed.t -> 'a -> Located.t
val internal_nrfunapp : 'a Expr.t Internal_fun.t -> 'a Expr.t list -> 'b -> ('a, 'b) t
val contains_fn_kind : ('a Expr.t Fun_kind.t -> bool) -> ?init:bool -> ('a, 'b) t -> bool
val mk_nested_for : Expr.Typed.t list -> (Expr.Typed.t list -> Located.t) -> Location_span.t -> Located.t
val assign_indexed : UnsizedType.t -> 'b Expr.t Pattern.lvalue -> 'a -> ('b Expr.t -> 'b Expr.t) -> 'b Expr.t -> ('b, 'a) t
val get_lhs_name : 'a Pattern.lvalue -> string

The name of the lhs. This adds "." and an index to tuple projections

val lvariable : string -> 'e Pattern.lvalue
val lvalue_of_expr_opt : 'e Expr.t -> 'e Expr.t Pattern.lvalue option
val expr_of_lvalue : 'e Expr.t Pattern.lvalue -> meta:'e -> 'e Expr.t
val map_lhs_variable : f:(string -> string) -> 'e Pattern.lvalue -> 'e Pattern.lvalue
val lhs_indices : 'e Pattern.lvalue -> 'e Index.t list
val lhs_variable : 'e Pattern.lvalue -> string

This gets the innermost name of the variable. It differs from get_lhs_name in that tuple projections do not add their indices here.

val lvalue_base_reference : 'e Pattern.lvalue -> 'e Pattern.lvalue

Reduce an lvalue down to its "base reference", which is a variable with maximum tuple indices after it. For example:

x[1,2][3] -> x
x.1[1,2].2[3].3 -> x.1
x.1.2[1,2][3].3 -> x.1.2