CommutativeExtractor

com.phasmidsoftware.number.expression.expr.CommutativeExtractor
abstract class CommutativeExtractor[A, B]

Abstract extractor for commutative binary operations. Handles trying both (left, right) and (right, left) orderings automatically.

Type parameters

A

the type extracted from the "left" position

B

the type extracted from the "right" position

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

protected def extractLeft(e: Expression): Option[A]

Extract value of type A from an expression.

Extract value of type A from an expression.

Attributes

protected def extractRight(e: Expression): Option[B]

Extract value of type B from an expression.

Extract value of type B from an expression.

Attributes

Concrete methods

def unapply(pair: (Expression, Expression)): Option[(A, B)]

Unapply method that tries both orderings on a tuple. First tries (extractLeft(left), extractRight(right)), then tries (extractLeft(right), extractRight(left)).

Unapply method that tries both orderings on a tuple. First tries (extractLeft(left), extractRight(right)), then tries (extractLeft(right), extractRight(left)).

Attributes