scalaz

Maybe

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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Maybe()

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    alias for toLeft

  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. final def \/>[B](b: ⇒ B): \/[B, A]

    alias for toRight

  8. final def asInstanceOf[T0]: T0

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

    Catamorphism.

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

  10. def clone(): AnyRef

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

  12. final def cojoin: Maybe[Maybe[A]]

  13. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

  18. def finalize(): Unit

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

    Tag with Tags.First

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

  21. final def forall(f: (A) ⇒ Boolean): Boolean

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

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

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

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

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

  25. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  26. final def isEmpty: Boolean

    True if no underlying value is present

  27. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  28. final def isJust: Boolean

    True if an underlying value is present

  29. final def last: LastMaybe[A]

    Tag with Tags.Last

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

  31. final def max: MaxMaybe[A]

    Tag with Tags.Max

  32. final def min: MinMaybe[A]

    Tag with Tags.Min

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

    Definition Classes
    AnyRef
  34. final def notify(): Unit

    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

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

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

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

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

  38. final def orError[F[_], E](e: E)(implicit F: MonadError[F, E]): F[A]

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

    Return the underlying value if present, otherwise the monoid zero

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

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

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

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

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

  43. final def toOption: Option[A]

    Convert to a standard library Option

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

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

  45. def toString(): String

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

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

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

    alias for orZero

  48. final def wait(): Unit

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

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

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

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

  53. final def |(a: ⇒ A): A

    alias for getOrElse

Inherited from AnyRef

Inherited from Any

Ungrouped