Builder
Builder for LoweredValue, to avoid boilerplate code. Import this object to make available
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Builder.type
Members list
Value members
Concrete methods
Low-level apply that skips automatic type/representation conversion.
Low-level apply that skips automatic type/representation conversion.
Use when the caller explicitly manages argument types and representations, e.g., in runtime conversion functions where arguments are intentionally in non-default representations.
Attributes
If lv is already identifiable, return it unchanged with false. Otherwise wrap it in a fresh lazy let-binding (lvNewLazyIdVar) with nameHint (uniqued), tp, and repr, returning the new identifiable plus true to signal the caller that it must add the binding to scope (e.g., via ScopeBracketsLoweredValue).
If lv is already identifiable, return it unchanged with false. Otherwise wrap it in a fresh lazy let-binding (lvNewLazyIdVar) with nameHint (uniqued), tp, and repr, returning the new identifiable plus true to signal the caller that it must add the binding to scope (e.g., via ScopeBracketsLoweredValue).
tp / repr are passed explicitly because some callers wrap the result of a toRepresentation conversion whose runtime type/repr differs from the source value's stored ones.
Note: when lv is already identifiable, tp and repr are ignored — the existing binding's stored shape is returned as-is. Callers that pass values different from lv.sirType / lv.representation must already have ensured the existing binding's shape matches what they need; otherwise the identifiable branch would silently mask a mismatch.
Attributes
Generate a case expression on a boolean value (PlutusV4 feature).
Generate a case expression on a boolean value (PlutusV4 feature).
In PlutusV4, Case can be used directly on boolean constants: Case(bool, [falseBranch, trueBranch]) where False = index 0 and True = index 1.
Attributes
Create a Case on Data for PlutusV4+.
Create a Case on Data for PlutusV4+.
Value parameters
- bBranch
-
the branch to execute for B case
- bValueVar
-
variable to bind to the bytestring value (ByteString)
- constrArgsVar
-
variable to bind to the constructor args (List[Data])
- constrBranch
-
the branch to execute for Constr case
- constrTagVar
-
variable to bind to the constructor tag (Integer)
- iBranch
-
the branch to execute for I case
- iValueVar
-
variable to bind to the integer value (Integer)
- inPos
-
source position
- listBranch
-
the branch to execute for List case
- listElementsVar
-
variable to bind to the list elements (List[Data])
- mapBranch
-
the branch to execute for Map case
- mapEntriesVar
-
variable to bind to the map entries (List[(Data, Data)])
- optTargetType
-
optional target type for the result
- scrutinee
-
the Data value to match on
Attributes
Generate a case expression on an integer value (PlutusV4 feature).
Generate a case expression on an integer value (PlutusV4 feature).
In PlutusV4, Case can be used directly on integer constants when cases form a contiguous sequence starting from 0: Case(int, [branch0, branch1, ..., branchN]).
Value parameters
- branches
-
list of branches indexed by integer value (0 -> branches(0), 1 -> branches(1), etc.)
- inPos
-
source position
- optTargetType
-
optional target type for the result
- scrutinee
-
the integer value to match on
Attributes
Generate a case expression on a list value (PlutusV4 feature).
Generate a case expression on a list value (PlutusV4 feature).
In PlutusV4, Case can be used directly on list constants: Case(list, [consBranch, nilBranch]) where Cons = index 0 (receives head and tail as arguments) and Nil = index 1 (no arguments).
Value parameters
- consBranch
-
the branch to execute for non-empty list (Cons)
- consHead
-
variable for the head element in cons branch
- consTail
-
variable for the tail list in cons branch
- inPos
-
source position
- nilBranch
-
the branch to execute for empty list (Nil)
- optTargetType
-
optional target type for the result
- scrutinee
-
the list value to match on
Attributes
Create a Case on Pair for PlutusV4+.
Create a Case on Pair for PlutusV4+.
Value parameters
- body
-
the body expression using fstVar and sndVar
- fstVar
-
variable to bind to the first element
- inPos
-
source position
- scrutinee
-
the pair to match on
- sndVar
-
variable to bind to the second element
Attributes
Nil for a BuiltinList[Data] with DataData element repr.
Nil for a BuiltinList[Data] with DataData element repr.
Attributes
create let and add it to the current scope.
create let and add it to the current scope.
Attributes
Nil for a BuiltinList[Data] used as product case constructor fields.
Nil for a BuiltinList[Data] used as product case constructor fields.
Attributes
Convert input to target via a static intermediate repr — i.e., input.toRepresentation(intermediate, pos).toRepresentation(target, pos). Replaces per-emitter viaXxx helpers (Phase 5).
Convert input to target via a static intermediate repr — i.e., input.toRepresentation(intermediate, pos).toRepresentation(target, pos). Replaces per-emitter viaXxx helpers (Phase 5).
For intermediates that depend on input.sirType (e.g. SumBuiltinList(defaultDataRep(elemType))), keep the per-emitter helper since the intermediate computation needs sirType context — this via only wraps the static case.