trait SafeInterpretation extends SafeCreation
- Alphabetic
- By Inheritance
- SafeInterpretation
- SafeCreation
- SafeTypes
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
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
attempt[R, A](action: Eff[R, A])(implicit m: /=[Safe, R]): Eff[R, Either[Throwable, A]]
try to execute an action an report any issue
-
def
attemptSafe[R, A](r: Eff[R, A])(implicit m: /=[Safe, R]): Eff[R, (EitherEffect.ThrowableEither[A], List[Throwable])]
Attempt to execute a safe action including finalizers
-
def
bracket[R, A, B, C](acquire: Eff[R, A])(use: (A) ⇒ Eff[R, B])(release: (A) ⇒ Eff[R, C])(implicit m: /=[Safe, R]): Eff[R, B]
get a resource A and use it.
get a resource A and use it. Call the release function whether an exception is thrown or not when using the resource
NOTE: Eff interpreters are independent so if there is an effect short-circuiting all computations inside 'use', like Option or Either then the release function will not be called. If you want to make sure that the release function is always called "at the end of the world and whatever happens" you need to call Eff.bracketLast
-
def
catchThrowable[R, A, B](action: Eff[R, A], pureValue: (A) ⇒ B, onThrowable: (Throwable) ⇒ Eff[R, B])(implicit m: /=[Safe, R]): Eff[R, B]
evaluate first action possibly having error effects
evaluate first action possibly having error effects
Execute a second action if the first one is not successful, based on the error
-
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
eval[R, A](a: Eval[A])(implicit arg0: _safe[R]): Eff[R, A]
- Definition Classes
- SafeCreation
-
def
exception[R, A](t: Throwable)(implicit arg0: _safe[R]): Eff[R, A]
- Definition Classes
- SafeCreation
-
def
execSafe[R, U, A](r: Eff[R, A])(implicit m: Aux[Safe, R, U]): Eff[U, EitherEffect.ThrowableEither[A]]
run a safe effect but drop the finalizer errors
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
finalizerException[R](t: Throwable)(implicit arg0: _safe[R]): Eff[R, Unit]
- Definition Classes
- SafeCreation
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
ignoreException[R, E <: Throwable, A](action: Eff[R, A])(implicit arg0: ClassTag[E], m: /=[Safe, R]): Eff[R, Unit]
ignore one possible exception that could be thrown
-
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
-
def
otherwise[R, A](action: Eff[R, A], onThrowable: Eff[R, A])(implicit m: /=[Safe, R]): Eff[R, A]
evaluate first action possibly having exceptions
evaluate first action possibly having exceptions
Execute a second action if the first one is not successful
-
def
protect[R, A](a: ⇒ A)(implicit arg0: _safe[R]): Eff[R, A]
- Definition Classes
- SafeCreation
-
def
recoverThrowable[R, A, B](action: Eff[R, A], pureValue: (A) ⇒ B, onThrowable: PartialFunction[Throwable, Eff[R, B]])(implicit m: /=[Safe, R]): Eff[R, B]
evaluate first action possibly having error effects
evaluate first action possibly having error effects
Execute a second action if the first one is not successful and second is defined for the error
-
def
runSafe[R, U, A](r: Eff[R, A])(implicit m: Aux[Safe, R, U]): Eff[U, (EitherEffect.ThrowableEither[A], List[Throwable])]
Run a safe effect
Run a safe effect
Collect finalizer exceptions if any
- def safeLoop[R, U, A]: Loop[Safe, R, A, Eff[U, (Either[Throwable, A], Vector[Throwable])], Eff[U, Unit]]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
thenFinally[R, A](action: Eff[R, A], last: Eff[R, Unit])(implicit m: /=[Safe, R]): Eff[R, A]
evaluate first action possibly having error effects execute a second action whether the first is successful or not but keep track of finalizer exceptions
-
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( ... )
-
def
whenFailed[R, A](action: Eff[R, A], onThrowable: (Throwable) ⇒ Eff[R, A])(implicit m: /=[Safe, R]): Eff[R, A]
evaluate first action possibly throwing exceptions
evaluate first action possibly throwing exceptions
Execute a second action if the first one is not successful, based on the exception
The final value type is the same as the original type
-
def
whenThrowable[R, A](action: Eff[R, A], onThrowable: PartialFunction[Throwable, Eff[R, A]])(implicit m: /=[Safe, R]): Eff[R, A]
evaluate first action possibly throwing exceptions
evaluate first action possibly throwing exceptions
Execute a second action if the first one is not successful and second is defined for the error
The final value type is the same as the original type