ExpressionFunction

com.phasmidsoftware.number.expression.expr.ExpressionFunction
See theExpressionFunction companion object
sealed trait ExpressionFunction[P] extends P => Valuable

Represents a named, generic computation or transformation from an input of type P to an output value of type Valuable. The ExpressionFunction trait defines an abstract function by extending the (P => Valuable) function type. It can be used to model mathematical or computational expressions with a specific name. It is the super-type of ExpressionMonoFunction and ExpressionBiFunction.

Type parameters

P

the type of the input parameter to the function

Attributes

Companion
object
Graph
Supertypes
trait P => Valuable
class Object
trait Matchable
class Any
Known subtypes
object Atan
object Log
object Power
object Product
object Sum
object Exp
class Hyperbolic
object Cosh
object Sinh
object Ln
object Negate
object Reciprocal
class SineCos
object Cosine
object Sine
Show all

Members list

Value members

Abstract methods

def applyExact(p: P): Option[Eager]

Applies the function exactly to the given input of type P, returning an Option of type Valuable if the application is successful.

Applies the function exactly to the given input of type P, returning an Option of type Valuable if the application is successful.

If defined, the output is guaranteed to be exact.

Value parameters

p

the input parameter of type P to which the function is applied

Attributes

Returns

an Option containing a Valuable result if the function executes successfully, or None if the operation cannot produce a valid result

def name: String

Returns the name of the expression function.

Returns the name of the expression function.

Attributes

Returns

a string representing the name of the function

Inherited methods

def andThen[A](g: Valuable => A): P => A

Composes two instances of Function1 in a new Function1, with this function applied first.

Composes two instances of Function1 in a new Function1, with this function applied first.

Type parameters

A

the result type of function g

Value parameters

g

a function R => A

Attributes

Returns

a new function f such that f(x) == g(apply(x))

Inherited from:
Function1
def compose[A](g: A => P): A => Valuable

Composes two instances of Function1 in a new Function1, with this function applied last.

Composes two instances of Function1 in a new Function1, with this function applied last.

Type parameters

A

the type to which function g can be applied

Value parameters

g

a function A => T1

Attributes

Returns

a new function f such that f(x) == apply(g(x))

Inherited from:
Function1
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1

Inherited and Abstract methods

def apply(v1: P): Valuable

Applies the body of this function to the argument.

Applies the body of this function to the argument.

Value parameters

v1

the function argument

Attributes

Returns

the result of function application.

Inherited from:
Function1