OptionFunctions

class Object
trait Matchable
class Any
object Scalaz
object option

Value members

Concrete methods

final
def cata[A, X](oa: Option[A])(some: A => X, none: => X): X

Catamorphism over the option. Returns the provided function some applied to item contained in the Option if it is defined, otherwise, the provided value none.

Catamorphism over the option. Returns the provided function some applied to item contained in the Option if it is defined, otherwise, the provided value none.

final
def fold[A, X](oa: Option[A])(some: A => X, none: => X): X

Alias for cata

Alias for cata

final
def foldLift[F[_], A, B](oa: Option[A])(b: => B, k: F[A] => B)(implicit p: Applicative[F]): B

Returns the given value if None, otherwise lifts the Some value and passes it to the given function.

Returns the given value if None, otherwise lifts the Some value and passes it to the given function.

final
def foldLiftOpt[A, B](oa: Option[A])(b: => B, k: Option[A] => B): B

Returns the given value if None, otherwise lifts the Some value to Option and passes it to the given function.

Returns the given value if None, otherwise lifts the Some value to Option and passes it to the given function.

final
def none[A]: Option[A]

scala.None with a sometimes more convenient type.

scala.None with a sometimes more convenient type.

final
def orEmpty[A, M[_] : PlusEmpty](oa: Option[A]): M[A]

Returns the item contained in the Option wrapped in type M if the Option is defined, otherwise, the empty value for type M.

Returns the item contained in the Option wrapped in type M if the Option is defined, otherwise, the empty value for type M.

final
def some[A](a: A): Option[A]

scala.Some.apply with a sometimes more convenient type.

scala.Some.apply with a sometimes more convenient type.

final
def toFailure[A, B](oa: Option[A])(b: => B): Validation[A, B]
final
def toFailureNel[A, B](oa: Option[A])(b: => B): ValidationNel[A, B]
final
def toLeft[A, B](oa: Option[A])(b: => B): A \/ B
final
def toMaybe[A](oa: Option[A]): Maybe[A]
final
def toRight[A, E](oa: Option[A])(e: => E): E \/ A
final
def toSuccess[A, E](oa: Option[A])(e: => E): Validation[E, A]
final
def toSuccessNel[A, E](oa: Option[A])(e: => E): ValidationNel[E, A]