MonadOps

com.phasmidsoftware.util.MonadOps
object MonadOps

Attributes

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

Members list

Value members

Concrete methods

def liftOption[T, R](f: T => R): (Option[T]) => Option[R]
def liftOptionToTry[T]: (Option[T]) => Try[T]
def liftTry[T, R](f: T => R): (Try[T]) => Try[R]
def map2[T1, T2, R](t1o: Option[T1], t2o: => Option[T2])(f: (T1, T2) => R): Option[R]

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]

def prune[K, V](x: Seq[(K, Option[V])]): Map[K, V]
def sequence[X](xys: Seq[Try[X]]): Try[Seq[X]]