IsZero

com.phasmidsoftware.number.expression.expr.IsZero
object IsZero

Companion object for the IsZero extractor.

This object provides a custom pattern matching mechanism for the Expression trait. It matches any Expression that evaluates to a zero value, allowing concise and readable extraction of such cases.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
IsZero.type

Members list

Value members

Concrete methods

def unapply(expr: Expression): Option[Expression]

Extractor method to match an Expression that evaluates to zero. If the given Expression has a zero value, the method returns Some(expr); otherwise, it returns None.

Extractor method to match an Expression that evaluates to zero. If the given Expression has a zero value, the method returns Some(expr); otherwise, it returns None.

Value parameters

expr

the Expression to check for a zero value

Attributes

Returns

an Option[Expression] containing the input expr if it evaluates to zero, or None otherwise