FP
This is a collection of general functional-programming-style methods. We could probably get these from ScalaZ but I'd rather have no dependencies.
TODO flesh out the unit tests (coverage is low).
TODO replace as an output type with type based on CanBuildFrom
CONSIDER replace Seq with Iterator in signatures
CONSIDER use higher-kinded monad types in order to implement methods for Try and Option at the same time
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
FP.type
Members list
Value members
Concrete methods
Type parameters
- X
-
the underlying type
Value parameters
- ox
-
the given Option
- x
-
the value we want to compare with ox
Attributes
- Returns
-
true if ox is Some(x)
Method to discriminate between (compare) two objects. This differs from regular comparison in that if the result of the primary comparison is zero, we try to discriminate by invoking the secondary comparator.
Method to discriminate between (compare) two objects. This differs from regular comparison in that if the result of the primary comparison is zero, we try to discriminate by invoking the secondary comparator.
Type parameters
- X
-
the underlying type
Value parameters
- f
-
the primary comparator
- g
-
the secondary comparator
- x1
-
the first object
- x2
-
the second object
Attributes
- Returns
-
a negative number if x1 is "less than" x2; a positive number if x1 is "greater than" x2; otherwise 0
An alternative method to map a pair of Option values (of same underlying type) into an Option value of another type (which could be the same of course) but with an additional guard function. If the guard function returns false, the f function will not be called and None will result.
An alternative method to map a pair of Option values (of same underlying type) into an Option value of another type (which could be the same of course) but with an additional guard function. If the guard function returns false, the f function will not be called and None will result.
Type parameters
- R
-
the result type
- T1
-
the underlying type of the first parameter
Value parameters
- f
-
function which takes a T1 and a T2 parameter and yields a R result
- g
-
guard function which takes a T1 and a T2 parameter and yields a Option[Boolean] result
- t1o
-
a Option[T1] value
- t2o
-
a Option[T2] value
Attributes
- Returns
-
a Option[U]
this isn't a particularly useful method: basically, it just strips away the Try part, returning an un-fulfilled Future.
this isn't a particularly useful method: basically, it just strips away the Try part, returning an un-fulfilled Future.
Type parameters
- X
-
the underlying type
Value parameters
- xfy
-
a Future[X] value wrapped in Try
Attributes
- Returns
-
an X value wrapped in Future
Type parameters
- X
-
the underlying type
Value parameters
- ec
-
the execution context
- xsfs
-
a sequence of futures, each wrapping a sequence of X
Attributes
- Returns
-
a sequence of X values wrapped in Future NOTE: that the output collection type will be Seq, regardless of the input type
TODO unit test
TODO unit test
Type parameters
- X
-
the underlying type
Value parameters
- esf
-
the collection to process
- executor
-
the executor to use
- f
-
the function to process left-hand-sides
Attributes
- Returns
-
a Future[Seq[X]] NOTE: that the output collection type will be Seq, regardless of the input type
This method performs a foldLeft with short-circuit logic
This method performs a foldLeft with short-circuit logic
Type parameters
- X
-
the underlying type of the iterator
- Y
-
the return type
Value parameters
- f
-
the function which accumulates the result: as with foldLeft, it takes a Y and an X and yields a Y
- q
-
the quick-return function: if this evaluates to true, given the new y value, that value is immediately returned
- xi
-
an iterator of X objects
- y0
-
the initial value of Y (e.g. 0 if Y is Int)
Attributes
- Returns
-
the aggregate of the given iterator, according to the initial value of y0 and the accumulator function f.
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 which takes the second parameter first
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 which takes the third parameter first, then the second, etc.
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 which takes the fourth parameter first, then the third, etc.
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 which takes the fourth parameter first, then the third, etc.
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 which takes the fourth parameter first, then the third, etc.
Lift function to transform a function f of type T=>R into a function of type Try[T]=>Try[R]
Lift function to transform a function f of type T=>R into a function of type Try[T]=>Try[R]
Type parameters
- R
-
the type of the result of f
- T
-
the type of the parameter to f
Value parameters
- f
-
the function we start with, of type T=>R
Attributes
- Returns
-
a function of type Try[T]=>Try[R]
Lift function to transform a function f of type (T1,T2)=>R into a function of type (Try[T1],Try[T2])=>Try[R]
Lift function to transform a function f of type (T1,T2)=>R into a function of type (Try[T1],Try[T2])=>Try[R]
Type parameters
- R
-
the type of the result of f
- T1
-
the type of the first parameter to f
- T2
-
the type of the second parameter to f
Value parameters
- f
-
the function we start with, of type (T1,T2)=>R
Attributes
- Returns
-
a function of type (Try[T1],Try[T2])=>Try[R]
TODO unit test
TODO unit test
A pure lift method to lift a function into Try
Type parameters
- T
-
the underlying source type
- U
-
the underlying result type
Value parameters
- f
-
a function which takes two T parameters and returns a U
Attributes
- Returns
-
the corresponding function which takes to Try[T] parameters and returns a Try[U]
Lift function to transform a function f of type (T1,T2,T3)=>R into a function of type (Try[T1],Try[T2],Try[T3])=>Try[R]
Lift function to transform a function f of type (T1,T2,T3)=>R into a function of type (Try[T1],Try[T2],Try[T3])=>Try[R]
Type parameters
- R
-
the type of the result of f
- T1
-
the type of the first parameter to f
- T2
-
the type of the second parameter to f
- T3
-
the type of the third parameter to f
Value parameters
- f
-
the function we start with, of type (T1,T2,T3)=>R
Attributes
- Returns
-
a function of type (Try[T1],Try[T2],Try[T3])=>Try[R]
Lift function to transform a function f of type (T1,T2,T3,T4,T5,T6,T7)=>R into a function of type (Try[T1],Try[T2],Try[T3],Try[T4],Try[T5],Try[T6],Try[T7])=>Try[R]
Lift function to transform a function f of type (T1,T2,T3,T4,T5,T6,T7)=>R into a function of type (Try[T1],Try[T2],Try[T3],Try[T4],Try[T5],Try[T6],Try[T7])=>Try[R]
Type parameters
- R
-
the type of the result of f
- T1
-
the type of the first parameter to f
- T2
-
the type of the second parameter to f
- T3
-
the type of the third parameter to f
- T4
-
the type of the fourth parameter to f
- T5
-
the type of the fifth parameter to f
- T6
-
the type of the sixth parameter to f
- T7
-
the type of the seventh parameter to f
Value parameters
- f
-
the function we start with, of type (T1,T2,T3,T4,T5,T6,T7)=>R
Attributes
- Returns
-
a function of type (Try[T1],Try[T2],Try[T3],Try[T4],Try[T5],Try[T6],Try[T7])=>Try[R]
TODO unit test
TODO unit test
A pure lift method to lift a function into Future
Type parameters
- T
-
the underlying source type
- U
-
the underlying result type
Value parameters
- executor
-
(implicit) execution context
- f
-
a function which takes two T parameters and returns a U
Attributes
- Returns
-
the corresponding function which takes to Future[T] parameters and returns a Future[U]
TODO unit test
TODO unit test
A pure lift method to lift a function into Option
Type parameters
- T
-
the underlying source type
- U
-
the underlying result type
Value parameters
- f
-
a function which takes two T parameters and returns a U
Attributes
- Returns
-
the corresponding function which takes to Option[T] parameters and returns an Option[U]
A true "lift" method which takes a function f (T=>U) and returns an Option[T]=>Try[T] This is a bit of an odd-ball function, not frequently used.
A true "lift" method which takes a function f (T=>U) and returns an Option[T]=>Try[T] This is a bit of an odd-ball function, not frequently used.
Type parameters
- T
-
the T type
- U
-
the U type
Value parameters
- f
-
a function which transforms an T into a U
Attributes
- Returns
-
the corresponding function which takes an Option[T] and returns a Try[U]
TODO unit test
TODO unit test
A true "lift" method which takes a function f (T=>U) and returns a Try[T]=>Try[T]
Type parameters
- T
-
the T type
- U
-
the U type
Value parameters
- f
-
a function which transforms an T into a U
Attributes
- Returns
-
the corresponding function which takes a Try[T] and returns a Try[U]
This method simply returns xy if it is a Success. If it's a Failure, then it will invoke function f, as a side-effect, and then return the failure but with a standard message. If the cause is fatal, then it will be thrown.
This method simply returns xy if it is a Success. If it's a Failure, then it will invoke function f, as a side-effect, and then return the failure but with a standard message. If the cause is fatal, then it will be thrown.
Similar to recover, recoverWith, etc.
Type parameters
- X
-
the underlying type of the return
Value parameters
- f
-
the function to process the cause of any failure
- xy
-
the Try[X] that is passed in (call-by-name)
Attributes
- Returns
-
a Try[X]
method to map a pair of Option values (of same underlying type) into an Option value of another type (which could be the same of course)
method to map a pair of Option values (of same underlying type) into an Option value of another type (which could be the same of course)
Type parameters
- R
-
the result type
- T1
-
the underlying type of the first parameter
Value parameters
- f
-
function which takes a T1 and a T2 parameter and yields a R result
- t1o
-
a Option[T1] value
- t2o
-
a Option[T2] value
Attributes
- Returns
-
a Option[U]
The map2 function.
The map2 function.
Type parameters
- R
-
the type of the result of function f
- T1
-
the type of parameter 1
- T2
-
the type of parameter 2
Value parameters
- f
-
function that takes two parameters of types T1 and T2 and returns a value of R
- t1y
-
parameter 1 wrapped in Try
- t2y
-
parameter 2 wrapped in Try
Attributes
- Returns
-
a value of R, wrapped in Try
method to map a pair of Option values (of same underlying type) into an Option value of another type (which could be the same of course) but with an additional guard function. If the guard function returns false, the f function will not be called and None will result.
method to map a pair of Option values (of same underlying type) into an Option value of another type (which could be the same of course) but with an additional guard function. If the guard function returns false, the f function will not be called and None will result.
Type parameters
- R
-
the result type
- T1
-
the underlying type of the first parameter
Value parameters
- f
-
function which takes a T1 and a T2 parameter and yields a R result
- g
-
guard function which takes a T1 and a T2 parameter and yields a Boolean result
- t1o
-
a Option[T1] value
- t2o
-
a Option[T2] value
Attributes
- Returns
-
a Option[U]
TODO unit test
TODO unit test
NOTE: not available with 2.10
method to map a pair of Try values (of same underlying type) into a Try value of another type (which could be the same of course)
Type parameters
- T
-
the input type
- U
-
the result type
Value parameters
- default
-
(implicit) a default value
- f
-
function which takes two T parameters and yields a U result
- g
-
(implicit) guard function which, given the first parameter's value, must be true for the second parameter (ty2) to be evaluated
- ty1
-
a Try[T] value
- ty2
-
a Try[T] value passed as call-by-name
Attributes
- Returns
-
a Try[U]
The map3 function. Much like map2
The map3 function. Much like map2
Type parameters
- R
-
the type of the result of function f
- T1
-
the type of parameter 1
- T2
-
the type of parameter 2
- T3
-
the type of parameter 3
Value parameters
- f
-
function that takes three parameters of types T1, T2 and T3 and returns a value of R
- t1y
-
parameter 1 wrapped in Option
- t2y
-
parameter 2 wrapped in Option
- t3y
-
parameter 3 wrapped in Option
Attributes
- Returns
-
a value of R, wrapped in Try
The map3 function. Much like map2
The map3 function. Much like map2
Type parameters
- R
-
the type of the result of function f
- T1
-
the type of parameter 1
- T2
-
the type of parameter 2
- T3
-
the type of parameter 3
Value parameters
- f
-
function that takes three parameters of types T1, T2 and T3 and returns a value of R
- t1y
-
parameter 1 wrapped in Try
- t2y
-
parameter 2 wrapped in Try
- t3y
-
parameter 3 wrapped in Try
Attributes
- Returns
-
a value of R, wrapped in Try
NOTE: not available with 2.10
NOTE: not available with 2.10
method to map a pair of Try values (of same underlying type) into a Try value of another type (which could be the same of course)
Type parameters
- T
-
the input type
- U
-
the result type
Value parameters
- default
-
(implicit) a default value
- f
-
function which takes two T parameters and yields a U result
- g
-
(implicit) guard function which, given the first parameter's value, must be true for the second parameter (ty2) to be evaluated; and which, given the second parameter's value, must be true for the third parameter (ty3) to be evaluated
- ty1
-
a Try[T] value
- ty2
-
a Try[T] value passed as call-by-name
- ty3
-
a Try[T] value passed as call-by-name
Attributes
- Returns
-
a Try[U]
You get the idea...
You get the idea...
Attributes
TODO unit test
TODO unit test
Type parameters
- R
-
the underlying result type
- T
-
the underlying source type
Value parameters
- f
-
a function which transforms a T into an R
Attributes
- Returns
-
a named function which takes a T and returns an R
Method to get the next element from an iterator, as an Option.
Method to get the next element from an iterator, as an Option.
Type parameters
- X
-
the underlying type.
Value parameters
- xi
-
the iterator.
Attributes
- Returns
-
Some(x) where x is the next element; or None where the iterator is exhausted.
Convert an Option[X] into a Try[X], given an explicit throwable for the None case
Convert an Option[X] into a Try[X], given an explicit throwable for the None case
Type parameters
- X
-
the underlying type of the input and the output
Value parameters
- t
-
a throwable which, wrapped in Failure, will be returned if xo is None
- xo
-
an X value wrapped in Option
Attributes
- Returns
-
an X value wrapped as a Try
Convert an Option[X] into a Try[X], using the default throwable for the None case
Convert an Option[X] into a Try[X], using the default throwable for the None case
Type parameters
- X
-
the underlying type of the input and the output
Value parameters
- xo
-
an X value wrapped in Option
Attributes
- Returns
-
an X value wrapped as a Try. If xo is None, then the result will be a NoSuchElementException wrapped in Failure
Perform recover on a sequence of Try objects.
Perform recover on a sequence of Try objects.
Type parameters
- X
-
the underlying type of the tries
Value parameters
- t
-
the Throwable to replace the nonfatal throwable already reported.
- xys
-
the sequence of tries
Attributes
- Returns
-
xys essentially unchanged though with the side-effect of having written any non-fatal exceptions to the console and all non-fatal failures replaced by Failure(t) NOTE: that the output collection type will be Seq, regardless of the input type
TODO unit test
TODO unit test
Type parameters
- A
-
the underlying type of the sequence
Value parameters
- as
-
a sequence of As
- limit
-
the limit of how many you want to show
Attributes
- Returns
-
a String representing the first "limit" elements of as
TODO unit test
TODO unit test
Type parameters
- X
-
the underlying type
Value parameters
- xy
-
a Try[X] value
Attributes
- Returns
-
Right[X] if successful, else a Left[X]
Transform a Future[X] into a Future of Either[Throwable,X]
Transform a Future[X] into a Future of Either[Throwable,X]
Type parameters
- X
-
the underlying type
Value parameters
- executor
-
an execution context
- xf
-
a Future[X]
Attributes
- Returns
-
a Future of Either[Throwable, X]
Type parameters
- X
-
the underlying type
Value parameters
- executor
-
an execution context
- xfs
-
a sequence of Future[X]
Attributes
- Returns
-
a Seq of Future of Either[Throwable, X] NOTE: that the output collection type will be Seq, regardless of the input type
Type parameters
- X
-
the underlying type
Value parameters
- xys
-
a sequence of Try[X]
Attributes
- Returns
-
a Try of Seq[X] NOTE: that the output collection type will be Seq, regardless of the input type
TODO unit test
TODO unit test
Type parameters
- X
-
the underlying type
Value parameters
- xys
-
a Stream of Try[X] values
Attributes
- Returns
-
a Stream[X] wrapped in a Try
TODO unit test
TODO unit test
Type parameters
- X
-
the underlying type
Value parameters
- xos
-
a sequence of Option[X] values
Attributes
- Returns
-
a sequence of X values wrapped in Option NOTE: that the output collection type will be Seq, regardless of the input type
TODO unit test
TODO unit test
Type parameters
- X
-
the underlying type
Value parameters
- xe
-
an Either[Throwable,X] object
Attributes
- Returns
-
an X value wrapped inside Option
Method to create an (immutable) Map from a sequence of tuples, such that order is preserved
Method to create an (immutable) Map from a sequence of tuples, such that order is preserved
Type parameters
- K
-
the underlying "key" type
- V
-
the underlying "value" type
Value parameters
- vKs
-
a sequence of (K,V) tuples
Attributes
- Returns
-
a ListMap[K,V]
Alternative to the toOption method in Option which, in my humble opinion, is dangerous because it's just too easy to lose failures. This method will throw any fatal failures, log any non-fatal failures and then convert the Try to an Option
Alternative to the toOption method in Option which, in my humble opinion, is dangerous because it's just too easy to lose failures. This method will throw any fatal failures, log any non-fatal failures and then convert the Try to an Option
Type parameters
- X
-
the underlying type of Try
Value parameters
- xy
-
the Try object
Attributes
- Returns
-
an Option which is Some(x) for Success(x) and None for Failure(t) where x has been handled as a side-effect
Method to convert a b into an Option[X]
Method to convert a b into an Option[X]
Type parameters
- X
-
the underlying type
Value parameters
- b
-
a Boolean value
- x
-
an X value
Attributes
- Returns
-
if b is true then Some(x) else None
Method to yield an Option[X] value based on a X-predicate and an X value.
Method to yield an Option[X] value based on a X-predicate and an X value.
Type parameters
- X
-
the underlying type of the value and the resulting Option
Value parameters
- p
-
the predicate
- t
-
the value to wrap in Some if the predicate is satisfied
Attributes
- Returns
-
Option[X]
TODO unit test
TODO unit test
Type parameters
- X
-
the input type of f
- Y
-
the output type of f
Value parameters
- f
-
a function which transforms an X into a Y
- x
-
an X value
Attributes
- Returns
-
a Try[Y]
This method uncurries the first two parameters of a three- (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 three- (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.
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
This method uncurries the first three parameters of a four- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first three parameters of f; whose second parameter is the third parameter, etc.
This method uncurries the first three parameters of a four- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first three parameters of f; whose second parameter is the third parameter, etc.
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
This method uncurries the first three parameters of a four- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first seven parameters of f; whose second parameter is the third parameter, etc.
This method uncurries the first three parameters of a four- (or more-) parameter curried function. The result is a (curried) function whose first parameter is a tuple of the first seven parameters of f; whose second parameter is the third parameter, etc.
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
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 which takes the parameters separately (as part of a parameter set)
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 which takes the parameters separately (as part of a parameter set)
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 which takes the parameters separately (as part of a parameter set)
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 which takes the parameters separately (as part of a parameter set)
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 which takes the parameters separately (as part of a parameter set)
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 which takes the parameters separately (as part of a parameter set)
Method to select an element from a tuple according to a Boolean value. You may invoke this method either as which(b)(x,y) or which (b)((x,y))
Method to select an element from a tuple according to a Boolean value. You may invoke this method either as which(b)(x,y) or which (b)((x,y))
Type parameters
- T
-
the underlying type
Value parameters
- b
-
a boolean
- t
-
a tuple
Attributes
- Returns
-
the first element of the tuple if b is true, else the second element
TODO unit test zip two options into an option of a tuple
TODO unit test zip two options into an option of a tuple
Type parameters
- A
-
the underlying type of the first parameter
- B
-
the underlying type of the second parameter
Value parameters
- ao
-
an A wrapped inside Option
- bo
-
a B wrapped inside Option
Attributes
- Returns
-
a tuple containing an A and a B value, all wrapped inside Option
TODO unit test zip two try values into a Try of a tuple
TODO unit test zip two try values into a Try of a tuple
Type parameters
- A
-
the underlying type of the first parameter
- B
-
the underlying type of the second parameter
Value parameters
- ao
-
an A wrapped inside Try
- bo
-
a B wrapped inside Try
Attributes
- Returns
-
a tuple containing an A and a B value, all wrapped inside Try
TODO unit test zip two Future values into a Future of a tuple
TODO unit test zip two Future values into a Future of a tuple
Type parameters
- A
-
the underlying type of the first parameter
- B
-
the underlying type of the second parameter
Value parameters
- af
-
an A wrapped inside Future
- bf
-
a B wrapped inside Future
Attributes
- Returns
-
a tuple containing an A and a B value, all wrapped inside Future
Method to zip two iterables together but in such a way that all elements are returned in one or other of the components of the result
Method to zip two iterables together but in such a way that all elements are returned in one or other of the components of the result
Type parameters
- A
-
the underlying type of as
- B
-
the underlying type of bs
Value parameters
- as
-
a iterable of As
- bs
-
a iterable of Bs
Attributes
- Returns
-
a Tuple3 which contains: the zip of as and bs; the remaining elements of as (if any); the remaining elements of bs (if any)