public abstract class Function extends Value
Value
.
Also see Value.Lambda
, and the standard Library
.Integral
and Derivative
were modified and CtsD2CtsD
added in 2020.)Modifier and Type | Class and Description |
---|---|
static class |
Function.Cts2Cts
The class of Cts → Cts Functions.
|
static class |
Function.Cts2Cts2Cts
Curried continuous functions,
R→R→R or more correctly
Cts→Cts→Cts. |
static class |
Function.CtsD2CtsD
Functions of Vectors of D Continuous Values,
RD→RD.
|
static interface |
Function.HasInverse
A Function, f, might have an inverse() Function.
|
static class |
Function.Native
|
static class |
Function.Native2
Curried native
Function s specified by
arbitrary Java code in apply2(v0,v1) . |
static class |
Function.Native3
3-Curried native
Function s specified by
arbitrary Java code in apply3(v0,v1,v2) . |
static class |
Function.WithInverse
This class exists so that one can create an anonymous
Function which (implements)
HasInverse . |
Value.Atomic, Value.Bool, Value.Char, Value.Chars, Value.Cts, Value.Defer, Value.Discrete, Value.Enum, Value.Inc_Or, Value.Int, Value.Lambda, Value.List, Value.Maybe, Value.Option, Value.Real, Value.Scannable, Value.Structured, Value.Triv, Value.Tuple
Constructor and Description |
---|
Function() |
Modifier and Type | Method and Description |
---|---|
abstract Value |
apply(Value p)
Apply 'this' Function to parameter 'p'.
|
Function |
bOp(int op,
Function g)
A binary operator on Functions 'this' (f) and 'g', such that
(f <op> g)(x) = f(x) <op> g(x).
|
static Function.Native2 |
fromBop(int op)
Return a
Curried Function based on the binary
operator, 'op' (+, *, etc.). |
static Function.Native |
fromUop(int op)
Return a Function, of one parameter, based on the unary operator
'op' (not, -, hd, etc.).
|
static void |
main(java.lang.String[] argv)
main() allows class Function to be very slightly tested,
in isolation.
|
java.lang.String |
toString()
Return the String "Function".
|
Type |
type()
Return
Type.FUNCTION . |
Function |
uOp(int op)
|
public Type type()
Type.FUNCTION
.public java.lang.String toString()
public Function uOp(int op)
apply(x)
=
f.apply(x).uOp(op)
.
Also see Function.Cts2Cts.uOp(int)
and Value.uOp(int)
.public Function bOp(int op, Function g)
Value.bOp(int, la.la.Value)
.public static Function.Native fromUop(int op)
uOp(int)
, Value.uOp(int)
,
and fromBop(int)
.public static Function.Native2 fromBop(int op)
Curried
Function based on the binary
operator, 'op' (+, *, etc.). For example,
((fromBop(+))x)y = x+y.
(Note that fromBop is a static method.)
Also see bOp(int, la.la.Function)
, Value.bOp(int, la.la.Value)
,
and fromUop(int)
.public static void main(java.lang.String[] argv)