trait MonadError[F[_], E] extends Serializable with Type[F]
The MonadError
type-class describes monads that can do error handling.
To implement MonadError
:
- inherit from MonadError.Type in derived type-classes
- inherit from MonadError.Instance when implementing instances
The purpose of this type-class is to support the data-types in the Monix library and it is considered a shim for a lawful type-class to be supplied by libraries such as Cats or Scalaz or equivalent.
CREDITS: The type-class encoding has been inspired by the Scato project by Aloïs Cochard and Scalaz 8 and the type has been extracted from Cats.
- Self Type
- Instance[F, E]
- Source
- MonadError.scala
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- MonadError
- Type
- Type
- Type
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Abstract Value Members
-
implicit abstract
def
applicative: Applicative[F]
- Definition Classes
- Type
-
implicit abstract
def
functor: Functor[F]
- Definition Classes
- Type
-
implicit abstract
def
monad: Monad[F]
- Definition Classes
- Type
-
abstract
def
onErrorHandle[A](fa: F[A])(f: (E) ⇒ A): F[A]
Handle any error, by mapping it to an
A
value. -
abstract
def
onErrorHandleWith[A](fa: F[A])(f: (E) ⇒ F[A]): F[A]
Handle any error, potentially recovering from it, by mapping it to an
F[A]
value. -
abstract
def
onErrorRecover[A](fa: F[A])(pf: PartialFunction[E, A]): F[A]
Recover from certain errors by mapping them to an
A
value. -
abstract
def
onErrorRecoverWith[A](fa: F[A])(pf: PartialFunction[E, F[A]]): F[A]
Recover from certain errors by mapping them to an
F[A]
value. -
abstract
def
raiseError[A](e: E): F[A]
Lift an error into the
F
context.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
This is the API documentation for the Monix library.
Package Overview
monix.execution exposes lower level primitives for dealing with asynchronous execution:
Atomic
types, as alternative tojava.util.concurrent.atomic
monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observable
pattern:Observable
implementationsmonix.types implements type-class shims, to be translated to type-classes provided by libraries such as Cats or Scalaz.
monix.cats is the optional integration with the Cats library, providing translations for the types described in
monix.types
.monix.scalaz is the optional integration with the Scalaz library, providing translations for the types described in
monix.types
.