Module Transl_comprehension_utils.Let_binding
First-class let bindings (mutable and immutable); we sometimes need to collect these while translating array comprehension clauses and bind them later.
module Let_kind : sig ... endLambda distinguishes between binding forms that bind an immutable (Llet) vs. mutable (Lmutlet) variable; however, we want to be able to abstract over these uniformly, as in some cases we will be collecting lists of variables we want to bind don't want to split the mutable and immutable ones apart. We thus combine the different immutable let_kinds with the option of having a mutable variable and use that to distinguish what sort of let we're generating.
type t = private {let_kind : Transl_comprehension_utils.Let_binding.Let_kind.t;layout : Lambda.layout;id : Ident.t;debug_uid : Lambda.debug_uid;init : Lambda.lambda;var : Lambda.lambda;
}The first-class (in OCaml) type of let bindings.
val make :
Transl_comprehension_utils.Let_binding.Let_kind.t ->
Lambda.layout ->
string ->
Lambda.debug_uid ->
Lambda.lambda ->
Transl_comprehension_utils.Let_binding.tCreate a fresh local identifier (with name as given by the string argument) to bind to an initial value given by the lambda argument.
val let_one :
Transl_comprehension_utils.Let_binding.t ->
Lambda.lambda ->
Lambda.lambdaCreate a Lambda let-binding (with Llet) from a first-class let binding, providing the body.
val let_all :
Transl_comprehension_utils.Let_binding.t list ->
Lambda.lambda ->
Lambda.lambdaCreate Lambda let-bindings (with Llet) from multiple first-class let bindings, providing the body.