final class OptionOps[A] extends AnyRef
- Source
- OptionOps.scala
- Alphabetic
- By Inheritance
- OptionOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def <\/[B](b: ⇒ B): \/[A, B]
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ?[X](s: ⇒ X): Conditional[X]
Ternary operator.
Ternary operator. Note that the arguments s and n are call-by-name.
Example
option ? "defined" | "undefined"
- final def \/>[E](e: ⇒ E): \/[E, A]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def cata[X](some: (A) ⇒ X, none: ⇒ X): X
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws(classOf[java.lang.CloneNotSupportedException])
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def err(message: ⇒ String): A
Returns the item contained in the Option if it is defined, otherwise, raises an error with the provided message.
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def first: @@[Option[A], First]
- final def foldLift[F[_], B](b: ⇒ B, k: (F[A]) ⇒ B)(implicit arg0: Applicative[F]): B
- final def foldLiftOpt[B](b: ⇒ B, k: (Option[A]) ⇒ B): B
- final def getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def getOrElseF[F[_]](fa: ⇒ F[A])(implicit arg0: Applicative[F]): F[A]
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def ifNone(n: ⇒ Unit): Unit
Executes the provided side effect if the Option if it is undefined.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def last: @@[Option[A], Last]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def orEmpty[M[_]](implicit arg0: Applicative[M], arg1: PlusEmpty[M]): M[A]
- final def orZero(implicit z: Monoid[A]): A
- final def some[X](s: (A) ⇒ X): Fold[X]
Returns the provided function
s
applied to item contained in the Option if it is defined, otherwise, the provided valuen
.Returns the provided function
s
applied to item contained in the Option if it is defined, otherwise, the provided valuen
.This is a syntactic alternative to scalaz.syntax.std.OptionOps#cata
Example:
o.some(_ * 2).none(0)
- final def synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- final def toFailure[B](b: ⇒ B): Validation[A, B]
- final def toFailureNel[B](b: ⇒ B): ValidationNel[A, B]
- final def toLeftDisjunction[B](b: ⇒ B): \/[A, B]
- final def toMaybe: Maybe[A]
- final def toRightDisjunction[E](e: ⇒ E): \/[E, A]
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def toSuccess[E](e: ⇒ E): Validation[E, A]
- final def toSuccessNel[E](e: ⇒ E): ValidationNel[E, A]
- final def unary_~(implicit z: Monoid[A]): A
Returns the item contained in the Option if it is defined, otherwise, the zero element for the type A
Returns the item contained in the Option if it is defined, otherwise, the zero element for the type A
For example:
val o: Option[List[String]] = None val a: List[String] = ~o // List()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws(classOf[java.lang.InterruptedException])
- final def |(a: ⇒ A): A
Returns the item contained in the Option if it is defined, otherwise, the provided argument.