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.
the result type of function g
a function R => A
a new function f
such that f(x) == g(apply(x))
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.
the type to which function g
can be applied
a function A => T1
a new function f
such that f(x) == apply(g(x))
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
A function of 1 parameter.
In the following example, the definition of succ is a shorthand for the anonymous class definition anonfun1:
Note that
Function1
does not define a total function, as might be suggested by the existence of scala.PartialFunction. The only distinction betweenFunction1
andPartialFunction
is that the latter can specify inputs which it will not handle.