trait
Catchable[F[_]] extends AnyRef
Abstract Value Members
-
abstract
def
attempt[A](f: F[A]): F[\/[Throwable, A]]
-
abstract
def
fail[A](err: Throwable): F[A]
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
A context in which exceptions can be caught and thrown.
This class places no other class constraints on
F
, but it should be the case that exceptions raised viafail
are caught by the nearest surroundingattempt
and returned as aLeft
. In addition to catching explicitly raised exceptions viafail
, we expect thatattempt
catch ambient exceptions that might occur when 'evaluating' anF
.We can state the requirement that
attempt
catch all ambient exceptions by stipulating that for all total functions of the formg: forall A . F[Throwable \/ A] => B
,g compose attempt
is also total.