QuasiIO

izumi.functional.quasi.QuasiIO
See theQuasiIO companion object
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.

Attributes

See also

izumi.distage.modules.DefaultModule - DefaultModule makes instances of QuasiIO 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

Companion
object
Graph
Supertypes
trait QuasiPrimitives[F]
trait QuasiApplicative[F]
trait QuasiFunctor[F]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Abstract methods

def bracketCase[A, B](acquire: => F[A])(release: (A, Option[Throwable]) => F[Unit])(use: A => F[B]): F[B]
def definitelyRecoverUnsafeIgnoreTrace[A](action: => F[A])(recover: Throwable => F[A]): F[A]

A stronger version of handleErrorWith (cats-effect) or catchAll (ZIO), the difference is that this will also intercept Throwable defects in ZIO, not only typed errors.

A stronger version of handleErrorWith (cats-effect) or catchAll (ZIO), the difference is that this will also intercept Throwable defects in ZIO, not only typed errors.

Attributes

Note

This function is meant for RECOVERING errors, for REPORTING errors use definitelyRecoverWithTrace and include the full trace of the error in the report.

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

Attributes

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.)

def fail[A](t: => Throwable): F[A]
def flatMap[A, B](fa: F[A])(f: A => F[B]): F[B]
def guaranteeOnInterrupt[A](fa: => F[A])(cleanupOnInterrupt: Trace[Nothing] => F[Unit]): F[A]
def maybeSuspend[A](eff: => A): F[A]

A weaker version of delay. Does not guarantee actual suspension of side-effects, because QuasiIO[Identity] is allowed

A weaker version of delay. Does not guarantee actual suspension of side-effects, because QuasiIO[Identity] is allowed

Attributes

def maybeSuspendEither[A](eff: => Either[Throwable, A]): F[A]
def redeem[A, B](action: => F[A])(failure: Throwable => F[B], success: A => F[B]): F[B]

Concrete methods

final def bracketAuto[A <: AutoCloseable, B](acquire: => F[A])(use: A => F[B]): F[B]
def guaranteeOnFailure[A](fa: => F[A])(cleanupOnFailure: Throwable => F[Unit]): F[A]
override def mkRef[A](a: A): F[QuasiRef[F, A]]

Attributes

Definition Classes
override def suspendF[A](effAction: => F[A]): F[A]

Attributes

Definition Classes

Inherited methods

def guarantee[A](fa: => F[A])(`finally`: => F[Unit]): F[A]

Attributes

Inherited from:
QuasiPrimitives
final def ifThenElse[A](cond: Boolean)(ifTrue: => F[A], ifFalse: => F[A]): F[A]

Attributes

Inherited from:
QuasiApplicative
def tailRecM[A, B](a: A)(f: A => F[Either[A, B]]): F[B]

Attributes

Inherited from:
QuasiPrimitives
def traverse[A, B](l: Iterable[A])(f: A => F[B]): F[List[B]]

Attributes

Inherited from:
QuasiPrimitives
def traverse_[A](l: Iterable[A])(f: A => F[Unit]): F[Unit]

Attributes

Inherited from:
QuasiPrimitives
final def unless(cond: Boolean)(ifFalse: => F[Unit]): F[Unit]

Attributes

Inherited from:
QuasiApplicative
final def when(cond: Boolean)(ifTrue: => F[Unit]): F[Unit]

Attributes

Inherited from:
QuasiApplicative
final def widen[A, B >: A](fa: F[A]): F[B]

Attributes

Inherited from:
QuasiFunctor

Inherited and Abstract methods

def bracket[A, B](acquire: => F[A])(release: A => F[Unit])(use: A => F[B]): F[B]

Attributes

Inherited from:
QuasiPrimitives
def map[A, B](fa: F[A])(f: A => B): F[B]

Attributes

Inherited from:
QuasiFunctor
def map2[A, B, C](fa: F[A], fb: => F[B])(f: (A, B) => C): F[C]

Attributes

Inherited from:
QuasiApplicative
def pure[A](a: A): F[A]

Attributes

Inherited from:
QuasiApplicative
def tapBothUntyped[A](eff: => F[A])(err: Any => F[Unit], succ: A => F[Unit]): F[A]

Attributes

Inherited from:
QuasiPrimitives
def uninterruptibleExcept[A](f: RestoreInterruption1[F] => F[A]): F[A]

Attributes

Inherited from:
QuasiPrimitives

Inherited fields

final val unit: F[Unit]

Attributes

Inherited from:
QuasiApplicative