Represents an expression consisting of a single term and a sequence of additional terms combined with operators, allowing for binary operations such as addition or subtraction.
Value parameters
t
the initial Term of the expression
ts
a list of pairs consisting of an operator and a subsequent Term
Evaluates the value of the expression represented by the Expr instance. This method computes the result by sequentially applying the termVal function to each term in the sequence ts using the operator plus to combine intermediary results.
Evaluates the value of the expression represented by the Expr instance. This method computes the result by sequentially applying the termVal function to each term in the sequence ts using the operator plus to combine intermediary results.
Attributes
Returns
a Try[Expression] representing the result of the evaluation. If all terms are successfully evaluated, it returns a Success containing the final result. If an error occurs, it returns a Failure describing the issue.