FP_Cross

com.phasmidsoftware.lascala.fp.FP_Cross
object FP_Cross

This is an 2.11-specific appendix to FP

Attributes

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

Members list

Value members

Concrete methods

def contains[X](ox: Option[X], x: X): Boolean

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)

def getFunctionRep(arity: Int): String
def map2lazy[T, U](ty1: Try[T], ty2: => Try[T])(f: (T, T) => U)(implicit g: T => Boolean = ..., default: Try[U] = ...): Try[U]

TODO unit test

TODO unit test

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]

def map3lazy[T, U](ty1: Try[T], ty2: => Try[T], ty3: => Try[T])(f: (T, T, T) => U)(implicit g: T => Boolean = ..., default: Try[U] = ...): Try[U]

TODO unit test

TODO unit test

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]