OptionalOps

final
class OptionalOps[F[_], A] extends Ops[F[A]]

Wraps a value self and provides methods related to Optional

trait Ops[F[A]]
class Object
trait Matchable
class Any

Type members

Classlikes

final
class Conditional[X](some: => X)

Value members

Concrete methods

def ?[X](some: => X): Conditional[X]

Returns some if this context is defined, otherwise none.

Returns some if this context is defined, otherwise none.

def getOrElse(default: => A): A

Returns the value within the context if defined or else the value of default.

Returns the value within the context if defined or else the value of default.

def isDefined: Boolean

Returns true if a value is defined within the context.

Returns true if a value is defined within the context.

def isEmpty: Boolean

Returns true if no value is defined within the context.

Returns true if no value is defined within the context.

def nonEmpty: Boolean

Returns true if a value is defined within the context.

Returns true if a value is defined within the context.

def orElse(alternative: => F[A]): F[A]

Returns this context if defined or else the value of the alternative.

Returns this context if defined or else the value of the alternative.

final
def pextract[B]: F[B] \/ A

If the value has an a, return it; otherwise it must be universally quantified.

If the value has an a, return it; otherwise it must be universally quantified.

def toMaybe: Maybe[A]

Returns this context converted to the Maybe context.

Returns this context converted to the Maybe context.

def toOption: Option[A]

Returns this context converted to the Option context.

Returns this context converted to the Option context.

Concrete fields

val self: F[A]

Implicits

Implicits

implicit
val F: Optional[F]