Applies this SIR term to an argument, creating an Apply node.
This method handles function application by:
The method supports both simple function types (SIRType.Fun) and polymorphic functions wrapped in type lambdas (SIRType.TypeLambda).
SIRType.Fun
SIRType.TypeLambda
the argument to apply to this function term
a SIR expression representing the function application, potentially wrapped in Decl nodes
if the term's type is not a function type
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)