Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Members list
Value members
Concrete methods
Applies this SIR term to an argument, creating an Apply node.
Applies this SIR term to an argument, creating an Apply node.
This method handles function application by:
- Stripping any Decl wrappers from the function term
- Extracting the result type from the function's type signature
- Creating an Apply node with the unwrapped function and argument
- Re-wrapping the result with the original Decl nodes
The method supports both simple function types (SIRType.Fun) and polymorphic functions wrapped in type lambdas (SIRType.TypeLambda).
Value parameters
- arg
-
the argument to apply to this function term
Attributes
- Returns
-
a SIR expression representing the function application, potentially wrapped in Decl nodes
- Throws
-
RuntimeException
if the term's type is not a function type
- Example
-
val f: SIR = ... // a function of type A -> B val arg: AnnotatedSIR = ... // an argument of type A val result: SIR = f $ arg // Apply(f, arg, B, anns)
Pretty-prints the SIR as a plain-text Doc.
Pretty-prints the SIR as a plain-text Doc.
Attributes
Pretty-prints the SIR as a Doc with XTerm color escape codes.
Pretty-prints the SIR as a Doc with XTerm color escape codes.
Attributes
Renders pretty at 80 columns.
Renders pretty at 80 columns.
Attributes
Renders prettyXTerm at 80 columns (colored, for terminal output).
First line of the rendered SIR, truncated to 60 characters - for log messages.
First line of the rendered SIR, truncated to 60 characters - for log messages.
Attributes
Lowers the SIR to a UPLC Term through the single scalus.compiler.sir.lowering.UplcPipeline (the same pipeline scalus.uplc.CompiledPlutus uses): removeTraces? -> mutual-recursion elimination -> static-argument transformation? -> backend lowering -> optimization? -> source-position back-fill.
Lowers the SIR to a UPLC Term through the single scalus.compiler.sir.lowering.UplcPipeline (the same pipeline scalus.uplc.CompiledPlutus uses): removeTraces? -> mutual-recursion elimination -> static-argument transformation? -> backend lowering -> optimization? -> source-position back-fill.
Intended for tests and inspection of the lowered term. For production scripts use scalus.uplc.PlutusV3.compile instead - it also produces the versioned program, serialized script, and script address.
Each parameter defaults to the corresponding field of the given Options and overrides it when passed explicitly.
Value parameters
- backend
-
the lowering backend; the default V3 backend is right for almost all uses
- debug
-
verbose lowering diagnostics
- generateErrorTraces
-
emit
tracecalls with error details on failure paths (bigger, costlier script) - optimizeUplc
-
run the SIR- and UPLC-level optimizers (what
Options.releaseenables)
Attributes
toUplc with optimizeUplc = true: lowers and runs the full optimizer pipeline.
toUplc with optimizeUplc = true: lowers and runs the full optimizer pipeline.
Intended for tests comparing optimized output. For production scripts use scalus.uplc.PlutusV3.compile with Options.release instead.
Attributes
Deprecated methods
Lowers with the given Options only (no parameter overrides).
Lowers with the given Options only (no parameter overrides).
Attributes
- Deprecated
-
[Since version 1.0.0]use toUplc instead
Exposes the V3 backend's intermediate lowering result.
Exposes the V3 backend's intermediate lowering result.
LoweredValue is compiler-internal IR with no stability guarantees, and this method bypasses the unified pipeline (no trace removal, no SIR-level optimization).
Attributes
- Deprecated
-
[Since version 1.0.0]internal lowering IR; use SirToUplcV3Lowering.fromOptions(sir, options).toLoweredValue() ".+("for lowering debugging, or PlutusV3.compile for compilation")