Class/Object

scalaz

Maybe

Related Docs: object Maybe | package scalaz

Permalink

sealed abstract class Maybe[A] extends AnyRef

An optional value

A Maybe[A] will either be a wrapped A instance (Just[A]), or a lack of underlying A instance (Empty[A]).

Maybe[A] is isomorphic to Option[A], however there are some differences between the two. Maybe is invariant in A while Option is covariant. Maybe[A] does not expose an unsafe get operation to access the underlying A value (that may not exist) like Option[A] does. Maybe[A] does not come with an implicit conversion to Iterable[A] (a trait with over a dozen super types).

Source
Maybe.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Maybe
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def <\/[B](b: ⇒ B): \/[A, B]

    Permalink

    alias for toLeft

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. final def \/>[B](b: ⇒ B): \/[B, A]

    Permalink

    alias for toRight

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. final def cata[B](f: (A) ⇒ B, b: ⇒ B): B

    Permalink

    Catamorphism.

    Catamorphism. Run the given function on the underlying value if present, otherwise return the provided fallback value

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def cobind[B](f: (Maybe[A]) ⇒ B): Maybe[B]

    Permalink
  10. final def cojoin: Maybe[Maybe[A]]

    Permalink
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def exists(f: (A) ⇒ Boolean): Boolean

    Permalink

    Return true if this is a Maybe.Just and the underlying value satisfies the provided predicate

  14. final def filter(f: (A) ⇒ Boolean): Maybe[A]

    Permalink
  15. final def filterNot(f: (A) ⇒ Boolean): Maybe[A]

    Permalink
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def first: FirstMaybe[A]

    Permalink

    Tag with Tags.First

  18. final def flatMap[B](f: (A) ⇒ Maybe[B]): Maybe[B]

    Permalink
  19. final def forall(f: (A) ⇒ Boolean): Boolean

    Permalink

    Return true if this is a Maybe.Empty or if this is a Maybe.Just and the underlying value satisfies the provided predicate

  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def getOrElse(a: ⇒ A): A

    Permalink

    Return the underlying value if present, otherwise the provided fallback value

  22. final def getOrElseF[F[_]](fa: ⇒ F[A])(implicit arg0: Applicative[F]): F[A]

    Permalink
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def isEmpty: Boolean

    Permalink

    True if no underlying value is present

  25. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  26. final def isJust: Boolean

    Permalink

    True if an underlying value is present

  27. final def last: LastMaybe[A]

    Permalink

    Tag with Tags.Last

  28. final def map[B](f: (A) ⇒ B): Maybe[B]

    Permalink
  29. final def max: MaxMaybe[A]

    Permalink

    Tag with Tags.Max

  30. final def min: MinMaybe[A]

    Permalink

    Tag with Tags.Min

  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def orElse(oa: ⇒ Maybe[A]): Maybe[A]

    Permalink

    Return this instance if it is a Maybe.Just, otherwise the provided fallback

  35. final def orEmpty[F[_]](implicit F: Applicative[F], G: PlusEmpty[F]): F[A]

    Permalink

    Return the underlying value wrapped in type F if present, otherwise the empty value for type F

  36. final def orZero(implicit F: Monoid[A]): A

    Permalink

    Return the underlying value if present, otherwise the monoid zero

  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  38. final def toFailure[B](b: ⇒ B): Validation[A, B]

    Permalink

    Turn the underlying value into a failure validation if present, otherwise return a success validation with the provided fallback value

  39. final def toLeft[B](b: ⇒ B): \/[A, B]

    Permalink

    Turn the underlying value into a left disjunction if present, otherwise return a right disjunction with the provided fallback value

  40. final def toOption: Option[A]

    Permalink

    Convert to a standard library Option

  41. final def toRight[B](b: ⇒ B): \/[B, A]

    Permalink

    Turn the underlying value into a right disjunction if present, otherwise return a left disjunction with the provided fallback value

  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. final def toSuccess[B](b: ⇒ B): Validation[B, A]

    Permalink

    Turn the underlying value into a success validation if present, otherwise return a failure validation with the provided fallback value

  44. final def unary_~(implicit z: Monoid[A]): A

    Permalink

    alias for orZero

  45. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def zip[B](fb: Maybe[B]): Maybe[(A, B)]

    Permalink
  49. final def zipWith[B, C](fb: Maybe[B])(f: (A, B) ⇒ C): Maybe[C]

    Permalink
  50. final def |(a: ⇒ A): A

    Permalink

    alias for getOrElse

Inherited from AnyRef

Inherited from Any

Ungrouped