Operations

com.phasmidsoftware.number.core.inner.Operations
object Operations

Object providing operations to evaluate dyadic and monadic functions on values, as well as query transformations.

Attributes

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

Members list

Value members

Concrete methods

def doComposeValueDyadic(value: Value, other: Value)(functions: DyadicFunctions): Option[Value]

Composes two Value instances dyadically, using the provided set of dyadic functions to determine the appropriate composition behavior based on their types.

Composes two Value instances dyadically, using the provided set of dyadic functions to determine the appropriate composition behavior based on their types.

Value parameters

functions

a tuple of dyadic functions (DyadicFunctions) which include functions for integer, rational, and double types, respectively.

other

the second Value instance to compose with the first.

value

the first Value instance to compose.

Attributes

Returns

an Option[Value] containing the result of the composition, or None if the operation fails.

def doQuery[T](v: Value, functions: QueryFunctions[T]): Option[T]

Executes a query operation on a given Value using the provided QueryFunctions. The query functions allow processing of the value based on its type (Int, Rational, or Double), returning an optional result of type T.

Executes a query operation on a given Value using the provided QueryFunctions. The query functions allow processing of the value based on its type (Int, Rational, or Double), returning an optional result of type T.

Value parameters

functions

an instance of QueryFunctions[T], which provides type-specific functions for querying integer, rational, and double values.

v

the Value to be queried.

Attributes

Returns

an Option[T] containing the result of applying the appropriate query function, or None if the query fails.

def doTransformValueMonadic(value: Value)(functions: MonadicFunctions): Option[Value]

Evaluate a monadic operator on this, using the various functions passed in. The result is an Option[Value] rather than a Number, as in Number's doComposeMonadic.

Evaluate a monadic operator on this, using the various functions passed in. The result is an Option[Value] rather than a Number, as in Number's doComposeMonadic.

Value parameters

functions

the tuple of four conversion functions.

Attributes

Returns

an Option[Value] which is result of applying the appropriate function to the given value.