SIR

scalus.compiler.sir.SIR
See theSIR companion object
sealed trait SIR

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait AnnotatedSIR
class And
class Apply
class Builtin
class Cast
class Const
class Constr
class Error
class ExternalVar
class IfThenElse
class LamAbs
class Let
class Match
class Not
class Or
class Select
class Var
class Decl
Show all

Members list

Value members

Abstract methods

def tp: SIRType

Concrete methods

infix def $(arg: AnnotatedSIR): SIR

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)
def lowerToUplc(using options: Options = ...): Term
Extension method from scalus
def pretty: Doc
Extension method from scalus
def prettyXTerm: Doc
Extension method from scalus
def show: String
Extension method from scalus
def showHighlighted: String
Extension method from scalus
def showShort: String
Extension method from scalus
def toLoweredValue(using options: Options = ...)(generateErrorTraces: Boolean = ..., debug: Boolean = ...): LoweredValue
Extension method from scalus
def toUplc(using options: Options = ...)(generateErrorTraces: Boolean = ..., backend: TargetLoweringBackend = ..., optimizeUplc: Boolean = ..., debug: Boolean = ...): Term
Extension method from scalus
def toUplcOptimized(using options: Options = ...)(generateErrorTraces: Boolean = ..., backend: TargetLoweringBackend = ..., debug: Boolean = ...): Term
Extension method from scalus
def ~=~(that: SIR): Boolean