Convenience method to produce the identity function term of a given type.
Convenience method to produce the identity function term of a given type.
Example usage:
def idAB[A, B] = TermExpr.id(typeExpr[A ⇒ B]) idAB.prettyPrint == "x ⇒ x" idAB.t.prettyPrint == "(A ⇒ B) ⇒ A ⇒ B"
Type for the argument of the identity function.
A term for the identity function.
Approximate size of the term.
Approximate size of the term.
The computation adds 1 every time any subterms are combined in any way.
For example, the size of the term x ⇒ y ⇒ x
is 5.
A term.
Number of elements in the term.
Replace all non-free occurrences of variable replaceVar
by expression byExpr
in origExpr
.
Replace all non-free occurrences of variable replaceVar
by expression byExpr
in origExpr
.
A variable that may occur freely in origExpr
.
A new expression to replace all free occurrences of that variable.
The original expression.
A new expression where the variable has been substituted.