Functional

com.phasmidsoftware.generic.Functional
object Functional

This is a collection of methods to manipulate functions. NOTE: these methods are not available in the Scala library.

Attributes

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

Members list

Value members

Concrete methods

def invert2[T1, T2, R](f: T1 => T2 => R): T2 => T1 => R

This method inverts the order of the first two parameters of a two-(or more-)parameter curried function.

This method inverts the order of the first two parameters of a two-(or more-)parameter curried function.

Type parameters

R

the result type

T1

the type of the first parameter

T2

the type of the second parameter

Value parameters

f

the function

Attributes

Returns

a curried function that takes the second parameter first

def invert2[T1, T2, R](f: (T1, T2) => R): (T2, T1) => R

This method inverts the order of the parameters of a two-parameter tupled function.

This method inverts the order of the parameters of a two-parameter tupled function.

Type parameters

R

the result type

T1

the type of the first parameter

T2

the type of the second parameter

Value parameters

f

the function

Attributes

Returns

a tupled function that takes the second parameter first

def invert3[T1, T2, T3, R](f: T1 => T2 => T3 => R): T3 => T2 => T1 => R

This method inverts the order of the first three parameters of a three-(or more-)parameter curried function.

This method inverts the order of the first three parameters of a three-(or more-)parameter curried function.

Type parameters

R

the result type

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

Value parameters

f

the function

Attributes

Returns

a curried function that takes the third parameter first, then the second, etc.

def invert3[T1, T2, T3, R](f: (T1, T2, T3) => R): (T3, T2, T1) => R

This method inverts the order of the parameters of a three-parameter tupled function.

This method inverts the order of the parameters of a three-parameter tupled function.

NOTE: for inversion of greater numbers of parameters, please use tupleN(invertN(f))

Type parameters

R

the result type

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

Value parameters

f

the function

Attributes

Returns

a tupled function that takes the parameters in reverse order

def invert4[T1, T2, T3, T4, R](f: T1 => T2 => T3 => T4 => R): T4 => T3 => T2 => T1 => R

This method inverts the order of the first four parameters of a four-(or more-)parameter curried function.

This method inverts the order of the first four parameters of a four-(or more-)parameter curried function.

Type parameters

R

the result type

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

Value parameters

f

the function

Attributes

Returns

a curried function that takes the fourth parameter first, then the third, etc.

def invert5[T1, T2, T3, T4, T5, R](f: T1 => T2 => T3 => T4 => T5 => R): T5 => T4 => T3 => T2 => T1 => R

This method inverts the order of the first four parameters of a four-(or more-)parameter curried function.

This method inverts the order of the first four parameters of a four-(or more-)parameter curried function.

Type parameters

R

the result type

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

T5

the type of the fifth parameter

Value parameters

f

the function

Attributes

Returns

a curried function that takes the fourth parameter first, then the third, etc.

def invert6[T1, T2, T3, T4, T5, T6, R](f: T1 => T2 => T3 => T4 => T5 => T6 => R): T6 => T5 => T4 => T3 => T2 => T1 => R

This method inverts the order of the first four parameters of a four-(or more-)parameter curried function.

This method inverts the order of the first four parameters of a four-(or more-)parameter curried function.

Type parameters

R

the result type

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

T5

the type of the fifth parameter

T6

the type of the sixth parameter

Value parameters

f

the function

Attributes

Returns

a curried function that takes the fourth parameter first, then the third, etc.

def invert7[T1, T2, T3, T4, T5, T6, T7, R](f: T1 => T2 => T3 => T4 => T5 => T6 => T7 => R): T7 => T6 => T5 => T4 => T3 => T2 => T1 => R

This method inverts the order of the first four parameters of a four-(or more-)parameter curried function.

This method inverts the order of the first four parameters of a four-(or more-)parameter curried function.

Type parameters

R

the result type

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

T5

the type of the fifth parameter

T6

the type of the sixth parameter

Value parameters

f

the function

Attributes

Returns

a curried function that takes the fourth parameter first, then the third, etc.

def tuple2[T1, T2, R](f: T1 => T2 => R): (T1, T2) => R

This method uncurries the first two parameters of a two- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first two parameters of f; whose second parameter is the third parameter, etc.

This method uncurries the first two parameters of a two- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first two parameters of f; whose second parameter is the third parameter, etc.

This method is similar to f.tupled in the Scala library but that method will tuple all parameters of a curried function. Here, we make it explicit how many parameters we wish to tuple.

Type parameters

R

the result type of function f

T1

the type of the first parameter

T2

the type of the second parameter

Value parameters

f

the function

Attributes

Returns

a (curried) function of type (T1,T2)=>T4=>R

def tuple3[T1, T2, T3, R](f: T1 => T2 => T3 => R): (T1, T2, T3) => R

This method uncurries the first three parameters of a three- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first three parameters of f;

This method uncurries the first three parameters of a three- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first three parameters of f;

Type parameters

R

the result type of function f

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

Value parameters

f

the function

Attributes

Returns

a (curried) function of type (T1,T2)=>T4=>R

def tuple4[T1, T2, T3, T4, R](f: T1 => T2 => T3 => T4 => R): (T1, T2, T3, T4) => R

This method uncurries the first four parameters of a four- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first four parameters of f;

This method uncurries the first four parameters of a four- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first four parameters of f;

Type parameters

R

the result type of function f

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

Value parameters

f

the function

Attributes

Returns

a (curried) function of type (T1,T2,T3,T4)=>R

def tuple5[T1, T2, T3, T4, T5, R](f: T1 => T2 => T3 => T4 => T5 => R): (T1, T2, T3, T4, T5) => R

This method uncurries the first five parameters of a five- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first five parameters of f;

This method uncurries the first five parameters of a five- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first five parameters of f;

Type parameters

R

the result type of function f

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

T5

the type of the fifth parameter

Value parameters

f

the function

Attributes

Returns

a (curried) function of type (T1,T2,T3,T4,T5)=>R

def tuple6[T1, T2, T3, T4, T5, T6, R](f: T1 => T2 => T3 => T4 => T5 => T6 => R): (T1, T2, T3, T4, T5, T6) => R

This method uncurries the first six parameters of a six- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first six parameters of f;

This method uncurries the first six parameters of a six- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first six parameters of f;

Type parameters

R

the result type of function f

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

T5

the type of the fifth parameter

T6

the type of the fifth parameter

Value parameters

f

the function

Attributes

Returns

a (curried) function of type (T1,T2,T3,T4,T5,T6)=>R

def tuple7[T1, T2, T3, T4, T5, T6, T7, R](f: T1 => T2 => T3 => T4 => T5 => T6 => T7 => R): (T1, T2, T3, T4, T5, T6, T7) => R

This method uncurries the first seven parameters of a seven- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first seven parameters of f;

This method uncurries the first seven parameters of a seven- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first seven parameters of f;

Type parameters

R

the result type of function f

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

T5

the type of the fifth parameter

T6

the type of the sixth parameter

T7

the type of the seventh parameter

Value parameters

f

the function

Attributes

Returns

a (curried) function of type (T1,T2,T3,T4,T5,T6,T7,T8)=>R

def tuple8[T1, T2, T3, T4, T5, T6, T7, T8, R](f: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => R): (T1, T2, T3, T4, T5, T6, T7, T8) => R

This method uncurries the first eight parameters of a eight- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first eight parameters of f;

This method uncurries the first eight parameters of a eight- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first eight parameters of f;

Type parameters

R

the result type of function f

T1

the type of the first parameter

T2

the type of the second parameter

T3

the type of the third parameter

T4

the type of the fourth parameter

T5

the type of the fifth parameter

T6

the type of the sixth parameter

T7

the type of the seventh parameter

T8

the type of the eighth parameter

Value parameters

f

the function

Attributes

Returns

a (curried) function of type (T1,T2,T3,T4,T5,T6,T7,T8)=>R

def untupled[T1, T2, R](f: ((T1, T2)) => R): (T1, T2) => R

This method (and the following similar methods) are missing from Function (or at least, the method in Function is flaky)

This method (and the following similar methods) are missing from Function (or at least, the method in Function is flaky)

Type parameters

R

the result type

T1

the first parameter type

T2

the second parameter type

Value parameters

f

the function to be untupled

Attributes

Returns

a function that takes the parameters separately (as part of a parameter set)

def untupled[T1, T2, T3, R](f: ((T1, T2, T3)) => R): (T1, T2, T3) => R

This method (and the following similar methods) are missing from Function (or at least, the method in Function is flaky)

This method (and the following similar methods) are missing from Function (or at least, the method in Function is flaky)

Type parameters

R

the result type

T1

the first parameter type

T2

the second parameter type

T3

the third parameter type

Value parameters

f

the function to be untupled

Attributes

Returns

a function that takes the parameters separately (as part of a parameter set)

def untupled[T1, T2, T3, T4, R](f: ((T1, T2, T3, T4)) => R): (T1, T2, T3, T4) => R

This method (and the following similar methods) are missing from Function (or at least, the method in Function is flaky)

This method (and the following similar methods) are missing from Function (or at least, the method in Function is flaky)

Type parameters

R

the result type

T1

the first parameter type

T2

the second parameter type

T3

the third parameter type

T4

the fourth parameter type

Value parameters

f

the function to be untupled

Attributes

Returns

a function that takes the parameters separately (as part of a parameter set)

def untupled[T1, T2, T3, T4, T5, R](f: ((T1, T2, T3, T4, T5)) => R): (T1, T2, T3, T4, T5) => R

This method (and the following similar methods) are missing from Function.

This method (and the following similar methods) are missing from Function.

Type parameters

R

the result type

T1

the first parameter type

T2

the second parameter type

T3

the third parameter type

T4

the fourth parameter type

T5

the fifth parameter type

Value parameters

f

the function to be untupled

Attributes

Returns

a function that takes the parameters separately (as part of a parameter set)

def untupled[T1, T2, T3, T4, T5, T6, R](f: ((T1, T2, T3, T4, T5, T6)) => R): (T1, T2, T3, T4, T5, T6) => R

This method (and the following similar methods) are missing from Function.

This method (and the following similar methods) are missing from Function.

Type parameters

R

the result type

T1

the first parameter type

T2

the second parameter type

T3

the third parameter type

T4

the fourth parameter type

T5

the fifth parameter type

T6

the sixth parameter type

Value parameters

f

the function to be untupled

Attributes

Returns

a function that takes the parameters separately (as part of a parameter set)

def untupled[T1, T2, T3, T4, T5, T6, T7, R](f: ((T1, T2, T3, T4, T5, T6, T7)) => R): (T1, T2, T3, T4, T5, T6, T7) => R

This method (and the following similar methods) are missing from Function.

This method (and the following similar methods) are missing from Function.

Type parameters

R

the result type

T1

the first parameter type

T2

the second parameter type

T3

the third parameter type

T4

the fourth parameter type

T5

the fifth parameter type

T6

the sixth parameter type

T7

the seventh parameter type

Value parameters

f

the function to be untupled

Attributes

Returns

a function that takes the parameters separately (as part of a parameter set)