trait QuasiIO[F[_]] extends QuasiPrimitives[F]
Evidence that F
is _almost_ like an IO
monad, but not quite –
because we also allow an impure izumi.fundamentals.platform.functional.Identity instance,
for which maybeSuspend
does not actually suspend!
If you use this interface and forget to add manual suspensions with by-name parameters everywhere, you're going to get weird behavior for Identity instance.
This interface serves internal needs of distage
for interoperability with all existing
Scala effect types and also with Identity
, you should NOT refer to it in your code if possible.
This type is public because you may want to define your own instances, if a suitable instance of izumi.distage.modules.DefaultModule is missing for your custom effect type. For application logic, prefer writing against typeclasses in izumi.functional.bio or cats instead.
- See also
izumi.distage.modules.DefaultModule -
DefaultModule
makes instances ofQuasiIO
for cats-effect, ZIO, monix, monix-bio,Identity
and others available for summoning in your wiring automatically TODO: we want to get rid of this by providing Identity implementations for relevant BIO typeclasses See https://github.com/7mind/izumi/issues/787
- Alphabetic
- By Inheritance
- QuasiIO
- QuasiPrimitives
- QuasiApplicative
- QuasiFunctor
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def bracket[A, B](acquire: => F[A])(release: (A) => F[Unit])(use: (A) => F[B]): F[B]
- Definition Classes
- QuasiPrimitives
- abstract def bracketCase[A, B](acquire: => F[A])(release: (A, Option[Throwable]) => F[Unit])(use: (A) => F[B]): F[B]
- abstract def definitelyRecoverUnsafeIgnoreTrace[A](action: => F[A])(recover: (Throwable) => F[A]): F[A]
A stronger version of
handleErrorWith
(cats-effect) orcatchAll
(ZIO), the difference is that this will _also_ intercept Throwable defects inZIO
, not only typed errors.A stronger version of
handleErrorWith
(cats-effect) orcatchAll
(ZIO), the difference is that this will _also_ intercept Throwable defects inZIO
, not only typed errors.- Note
This function is meant for _RECOVERING_ errors, for _REPORTING_ errors use definitelyRecoverWithTrace and include the full trace of the error in the report.
- abstract def definitelyRecoverWithTrace[A](action: => F[A])(recoverWithTrace: (Throwable, Trace[Throwable]) => F[A]): F[A]
Like definitelyRecoverUnsafeIgnoreTrace, but the second parameter to the callback contains the effect's debugging information, possibly convertable to a Throwable via Exit.Trace#toThrowable, or that could be used to mutably enhance the left-hand-side Throwable value via Exit.Trace#unsafeAttachTrace
Like definitelyRecoverUnsafeIgnoreTrace, but the second parameter to the callback contains the effect's debugging information, possibly convertable to a Throwable via Exit.Trace#toThrowable, or that could be used to mutably enhance the left-hand-side Throwable value via Exit.Trace#unsafeAttachTrace
- Note
Exit.Trace#unsafeAttachTrace may perform side-effects to the original Throwable argument on the left, the left throwable should be DISCARDED after calling the callback. (e.g. in case of
ZIO
, the callback will mutate the throwable and attach a ZIO Trace to it.)
- abstract def fail[A](t: => Throwable): F[A]
- abstract def flatMap[A, B](fa: F[A])(f: (A) => F[B]): F[B]
- Definition Classes
- QuasiIO → QuasiPrimitives
- abstract def map[A, B](fa: F[A])(f: (A) => B): F[B]
- Definition Classes
- QuasiFunctor
- abstract def map2[A, B, C](fa: F[A], fb: => F[B])(f: (A, B) => C): F[C]
- Definition Classes
- QuasiApplicative
- abstract def maybeSuspend[A](eff: => A): F[A]
A weaker version of
delay
.A weaker version of
delay
. Does not guarantee _actual_ suspension of side-effects, because QuasiIO[Identity] is allowed - abstract def maybeSuspendEither[A](eff: => Either[Throwable, A]): F[A]
- abstract def pure[A](a: A): F[A]
- Definition Classes
- QuasiApplicative
- abstract def redeem[A, B](action: => F[A])(failure: (Throwable) => F[B], success: (A) => F[B]): F[B]
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
- final def bracketAuto[A <: AutoCloseable, B](acquire: => F[A])(use: (A) => F[B]): F[B]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def guarantee[A](fa: => F[A])(finally: => F[Unit]): F[A]
- Definition Classes
- QuasiPrimitives
- def guaranteeOnFailure[A](fa: => F[A])(cleanupOnFailure: (Throwable) => F[Unit]): F[A]
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def ifThenElse[A](cond: Boolean)(ifTrue: => F[A], ifFalse: => F[A]): F[A]
- Definition Classes
- QuasiApplicative
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mkRef[A](a: A): F[QuasiRef[F, A]]
- Definition Classes
- QuasiIO → QuasiPrimitives
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def suspendF[A](effAction: => F[A]): F[A]
- Definition Classes
- QuasiIO → QuasiPrimitives
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tailRecM[A, B](a: A)(f: (A) => F[Either[A, B]]): F[B]
- Definition Classes
- QuasiPrimitives
- def toString(): String
- Definition Classes
- AnyRef → Any
- def traverse[A, B](l: Iterable[A])(f: (A) => F[B]): F[List[B]]
- Definition Classes
- QuasiPrimitives → QuasiApplicative
- def traverse_[A](l: Iterable[A])(f: (A) => F[Unit]): F[Unit]
- Definition Classes
- QuasiPrimitives → QuasiApplicative
- final val unit: F[Unit]
- Definition Classes
- QuasiApplicative
- final def unless(cond: Boolean)(ifFalse: => F[Unit]): F[Unit]
- Definition Classes
- QuasiApplicative
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def when(cond: Boolean)(ifTrue: => F[Unit]): F[Unit]
- Definition Classes
- QuasiApplicative
- final def widen[A, B >: A](fa: F[A]): F[B]
- Definition Classes
- QuasiFunctor