Panic2Instance

izumi.functional.bio.data.FreePanic$.Panic2Instance$
See thePanic2Instance companion class
object Panic2Instance extends Panic2Instance[Nothing]

Attributes

Companion:
class
Graph
Supertypes
class Panic2Instance[Nothing]
trait Panic3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait Bracket3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait Error3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait Monad3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait ApplicativeError3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait Bifunctor3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait Guarantee3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait Applicative3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait Functor3[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait RootBifunctor[[R, E, A] =>> FreePanic[Nothing, E, A]]
trait Root
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Inherited types

Attributes

Inherited from:
DivergenceHelper

Attributes

Inherited from:
PredefinedHelper

Value members

Inherited methods

final override def *>[R, E, A, B](f: FreePanic[Nothing, E, A], next: => FreePanic[Nothing, E, B]): FreePanic[S, E, B]

execute two operations in order, return result of second operation

execute two operations in order, return result of second operation

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def <*[R, E, A, B](f: FreePanic[Nothing, E, A], next: => FreePanic[Nothing, E, B]): FreePanic[S, E, A]

execute two operations in order, same as *>, but return result of first operation

execute two operations in order, same as *>, but return result of first operation

Attributes

Definition Classes
Inherited from:
Panic2Instance
override def InnerF: Functor3[F]

Attributes

Definition Classes
Inherited from:
ApplicativeError3
final override def as[R, E, A, B](r: FreePanic[Nothing, E, A])(v: => B): FreePanic[S, E, B]

Attributes

Definition Classes
Inherited from:
Panic2Instance
def attempt[R, E, A](r: FreePanic[Nothing, E, A]): F[R, Nothing, Either[E, A]]

Attributes

Inherited from:
Error3
override def bimap[R, E, A, E2, B](r: FreePanic[Nothing, E, A])(f: E => E2, g: A => B): F[R, E2, B]

Attributes

Definition Classes
Inherited from:
Error3
def bracket[R, E, A, B](acquire: FreePanic[Nothing, E, A])(release: A => FreePanic[Nothing, Nothing, Unit])(use: A => FreePanic[Nothing, E, B]): F[R, E, B]

Attributes

Inherited from:
Bracket3
final override def bracketCase[R, E, A, B](acquire: FreePanic[Nothing, E, A])(release: (A, Exit[E, B]) => FreePanic[Nothing, Nothing, Unit])(use: A => FreePanic[Nothing, E, B]): FreePanic[S, E, B]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def bracketExcept[R, E, A, B](acquire: RestoreInterruption2[[_, _] =>> FreePanic[Nothing, _$96, _$97]] => FreePanic[Nothing, E, A])(release: (A, Exit[E, B]) => FreePanic[Nothing, Nothing, Unit])(use: A => FreePanic[Nothing, E, B]): FreePanic[S, E, B]

Like bracketCase, but acquire can contain marked interruptible regions as in uninterruptibleExcept

Like bracketCase, but acquire can contain marked interruptible regions as in uninterruptibleExcept

Attributes

Definition Classes
Inherited from:
Panic2Instance
final def bracketOnFailure[R, E, A, B](acquire: FreePanic[Nothing, E, A])(cleanupOnFailure: (A, Failure[E]) => FreePanic[Nothing, Nothing, Unit])(use: A => FreePanic[Nothing, E, B]): F[R, E, B]

Run release action only on a failure – any failure, INCLUDING interruption. Do not run release action if use finished successfully.

Run release action only on a failure – any failure, INCLUDING interruption. Do not run release action if use finished successfully.

Attributes

Inherited from:
Bracket3
final override def catchAll[R, E, A, E2](r: FreePanic[Nothing, E, A])(f: E => FreePanic[Nothing, E2, A]): FreePanic[S, E2, A]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def catchSome[R, E, A, E1 >: E](r: FreePanic[Nothing, E, A])(f: PartialFunction[E, FreePanic[Nothing, E1, A]]): FreePanic[S, E1, A]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def fail[E](v: => E): FreePanic[S, E, Nothing]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def flatMap[R, E, A, B](r: FreePanic[Nothing, E, A])(f: A => FreePanic[Nothing, E, B]): FreePanic[S, E, B]

Attributes

Definition Classes
Inherited from:
Panic2Instance
def flatten[R, E, A](r: FreePanic[Nothing, E, FreePanic[Nothing, E, A]]): F[R, E, A]

Attributes

Inherited from:
Monad3
def flip[R, E, A](r: FreePanic[Nothing, E, A]): F[R, A, E]

Attributes

Inherited from:
Error3
final def forever[R, E, A](r: FreePanic[Nothing, E, A]): F[R, E, Nothing]

Attributes

Inherited from:
Applicative3
final override def fromEither[E, V](effect: => Either[E, V]): FreePanic[S, E, V]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def fromOption[E, A](errorOnNone: => E)(effect: => Option[A]): FreePanic[S, E, A]

Attributes

Definition Classes
Inherited from:
Panic2Instance
def fromOption[R, E, A](errorOnNone: => E, r: FreePanic[Nothing, E, Option[A]]): F[R, E, A]

Extracts the optional value or fails with the errorOnNone error

Extracts the optional value or fails with the errorOnNone error

Attributes

Inherited from:
Error3
def fromOptionF[R, E, A](fallbackOnNone: => FreePanic[Nothing, E, A], r: FreePanic[Nothing, E, Option[A]]): F[R, E, A]

Extracts the optional value, or executes the fallbackOnNone effect

Extracts the optional value, or executes the fallbackOnNone effect

Attributes

Inherited from:
Monad3
def fromOptionOr[R, E, A](valueOnNone: => A, r: FreePanic[Nothing, E, Option[A]]): F[R, E, A]

Extracts the optional value, or returns the given valueOnNone value

Extracts the optional value, or returns the given valueOnNone value

Attributes

Inherited from:
Functor3
final override def fromTry[A](effect: => Try[A]): FreePanic[S, Throwable, A]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def guarantee[R, E, A](f: FreePanic[Nothing, E, A], cleanup: FreePanic[Nothing, Nothing, Unit]): FreePanic[S, E, A]

Attributes

Definition Classes
Inherited from:
Panic2Instance
def guaranteeCase[R, E, A](f: FreePanic[Nothing, E, A], cleanup: Exit[E, A] => FreePanic[Nothing, Nothing, Unit]): F[R, E, A]

Attributes

Inherited from:
Bracket3
final def guaranteeExceptOnInterrupt[R, E, A](f: FreePanic[Nothing, E, A], cleanupOnNonInterruption: Either[Termination, Either[Error[E], Success[A]]] => FreePanic[Nothing, Nothing, Unit]): F[R, E, A]

Run cleanup on both success and failure, if the failure IS NOT an interruption.

Run cleanup on both success and failure, if the failure IS NOT an interruption.

Attributes

Inherited from:
Bracket3
final def guaranteeOnFailure[R, E, A](f: FreePanic[Nothing, E, A], cleanupOnFailure: Failure[E] => FreePanic[Nothing, Nothing, Unit]): F[R, E, A]

Run cleanup only on a failure – any failure, INCLUDING interruption. Do not run cleanup if use finished successfully.

Run cleanup only on a failure – any failure, INCLUDING interruption. Do not run cleanup if use finished successfully.

Attributes

Inherited from:
Bracket3
final def guaranteeOnInterrupt[R, E, A](f: FreePanic[Nothing, E, A], cleanupOnInterruption: Interruption => FreePanic[Nothing, Nothing, Unit]): F[R, E, A]

Run cleanup only on interruption. Do not run cleanup if use finished successfully.

Run cleanup only on interruption. Do not run cleanup if use finished successfully.

Attributes

Inherited from:
Bracket3
final def ifThenElse[R, E, E1, A](cond: FreePanic[Nothing, E, Boolean])(ifTrue: => FreePanic[Nothing, E1, A], ifFalse: => FreePanic[Nothing, E1, A])(implicit ev: E <:< E1): F[R, E1, A]

Attributes

Inherited from:
Monad3
final def ifThenElse[R, E, A](cond: Boolean)(ifTrue: => FreePanic[Nothing, E, A], ifFalse: => FreePanic[Nothing, E, A]): F[R, E, A]

Attributes

Inherited from:
Applicative3
def iterateUntil[R, E, A](r: FreePanic[Nothing, E, A])(p: A => Boolean): F[R, E, A]

Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.

Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.

Attributes

Inherited from:
Monad3
def iterateUntilF[R, E, A](init: A)(f: A => FreePanic[Nothing, E, A])(p: A => Boolean): F[R, E, A]

Apply an effectful function iteratively until its result satisfies the given predicate and return that result.

Apply an effectful function iteratively until its result satisfies the given predicate and return that result.

Attributes

Inherited from:
Monad3
def iterateWhile[R, E, A](r: FreePanic[Nothing, E, A])(p: A => Boolean): F[R, E, A]

Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.

Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.

Attributes

Inherited from:
Monad3
def iterateWhileF[R, E, A](init: A)(f: A => FreePanic[Nothing, E, A])(p: A => Boolean): F[R, E, A]

Apply an effectful function iteratively until its result fails to satisfy the given predicate and return that result.

Apply an effectful function iteratively until its result fails to satisfy the given predicate and return that result.

Attributes

Inherited from:
Monad3
def leftFlatMap[R, E, A, E2](r: FreePanic[Nothing, E, A])(f: E => FreePanic[Nothing, Nothing, E2]): F[R, E2, A]

Attributes

Inherited from:
Error3
def leftMap[R, E, A, E2](r: FreePanic[Nothing, E, A])(f: E => E2): F[R, E2, A]

Attributes

Inherited from:
Bifunctor3
override def leftMap2[R, E, A, E2, E3](firstOp: FreePanic[Nothing, E, A], secondOp: => FreePanic[Nothing, E2, A])(f: (E, E2) => E3): F[R, E3, A]

map errors from two operations into a new error if both fail

map errors from two operations into a new error if both fail

Attributes

Definition Classes
Inherited from:
Error3
override def map[R, E, A, B](r: FreePanic[Nothing, E, A])(f: A => B): F[R, E, B]

Attributes

Definition Classes
Inherited from:
Monad3
override def map2[R, E, A, B, C](r1: FreePanic[Nothing, E, A], r2: => FreePanic[Nothing, E, B])(f: (A, B) => C): F[R, E, C]

execute two operations in order, map their results

execute two operations in order, map their results

Attributes

Definition Classes
Inherited from:
Monad3
override def orElse[R, E, A, E2](r: FreePanic[Nothing, E, A], f: => FreePanic[Nothing, E2, A]): F[R, E2, A]

execute second operation only if the first one fails

execute second operation only if the first one fails

Attributes

Definition Classes
Inherited from:
Error3
final def orTerminate[R, A](r: FreePanic[Nothing, Throwable, A]): F[R, Nothing, A]

Attributes

Inherited from:
Panic3
final override def pure[A](a: A): FreePanic[S, Nothing, A]

Attributes

Definition Classes
Inherited from:
Panic2Instance
def redeem[R, E, A, E2, B](r: FreePanic[Nothing, E, A])(err: E => FreePanic[Nothing, E2, B], succ: A => FreePanic[Nothing, E2, B]): F[R, E2, B]

Attributes

Inherited from:
Error3
def redeemPure[R, E, A, B](r: FreePanic[Nothing, E, A])(err: E => B, succ: A => B): F[R, Nothing, B]

Attributes

Inherited from:
Error3
def retryUntil[R, E, A](r: FreePanic[Nothing, E, A])(f: E => Boolean): F[R, E, A]

Retries this effect until its error satisfies the specified predicate.

Retries this effect until its error satisfies the specified predicate.

Attributes

Inherited from:
Error3
def retryUntilF[R, R1 <: R, E, A](r: FreePanic[Nothing, E, A])(f: E => FreePanic[Nothing, Nothing, Boolean]): F[R1, E, A]

Retries this effect until its error satisfies the specified effectful predicate.

Retries this effect until its error satisfies the specified effectful predicate.

Attributes

Inherited from:
Error3
def retryWhile[R, E, A](r: FreePanic[Nothing, E, A])(f: E => Boolean): F[R, E, A]

Retries this effect while its error satisfies the specified predicate.

Retries this effect while its error satisfies the specified predicate.

Attributes

Inherited from:
Error3
def retryWhileF[R, R1 <: R, E, A](r: FreePanic[Nothing, E, A])(f: E => FreePanic[Nothing, Nothing, Boolean]): F[R1, E, A]

Retries this effect while its error satisfies the specified effectful predicate.

Retries this effect while its error satisfies the specified effectful predicate.

Attributes

Inherited from:
Error3
final override def sandbox[R, E, A](r: FreePanic[Nothing, E, A]): FreePanic[S, Failure[E], A]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def sendInterruptToSelf: FreePanic[S, Nothing, Unit]

Signal interruption to this fiber.

Signal interruption to this fiber.

This is NOT the same as

 F.halt(Exit.Interrupted(Trace.empty))

The code above exits with Exit.Interrupted failure unconditionally, whereas sendInterruptToSelf will not exit when in an uninterruptible region. Example:

 F.uninterruptible {
   F.halt(Exit.Interrupted(Trace.empty)) *>
   F.sync(println("Hello!")) // interrupted above. Hello _not_ printed
 }

But with sendInterruptToSelf:

 F.uninterruptible {
   F.sendInterruptToSelf *>
   F.sync(println("Hello!")) // Hello IS printed.
 } *> F.sync(println("Impossible")) // interrupted immediately after `uninterruptible` block ends. Impossible _not_ printed

Attributes

See also:
Definition Classes
Inherited from:
Panic2Instance
def sequence[R, E, A, B](l: Iterable[FreePanic[Nothing, E, A]]): F[R, E, List[A]]

Attributes

Inherited from:
Applicative3
def sequence_[R, E](l: Iterable[FreePanic[Nothing, E, Unit]]): F[R, E, Unit]

Attributes

Inherited from:
Applicative3
def tailRecM[R, E, A, B](a: A)(f: A => FreePanic[Nothing, E, Either[A, B]]): F[R, E, B]

Attributes

Inherited from:
Monad3
def tap[R, E, A](r: FreePanic[Nothing, E, A], f: A => FreePanic[Nothing, E, Unit]): F[R, E, A]

Attributes

Inherited from:
Monad3
def tapBoth[R, E, A, E1 >: E](r: FreePanic[Nothing, E, A])(err: E => FreePanic[Nothing, E1, Unit], succ: A => FreePanic[Nothing, E1, Unit]): F[R, E1, A]

Attributes

Inherited from:
Error3
def tapError[R, E, A, E1 >: E](r: FreePanic[Nothing, E, A])(f: E => FreePanic[Nothing, E1, Unit]): F[R, E1, A]

Attributes

Inherited from:
Error3
final override def terminate(v: => Throwable): FreePanic[S, Nothing, Nothing]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final def traverse[R, E, A, B](o: Option[A])(f: A => FreePanic[Nothing, E, B]): F[R, E, Option[B]]

Attributes

Inherited from:
Applicative3
def traverse[R, E, A, B](l: Iterable[A])(f: A => FreePanic[Nothing, E, B]): F[R, E, List[B]]

Attributes

Inherited from:
Applicative3
def traverse_[R, E, A](l: Iterable[A])(f: A => FreePanic[Nothing, E, Unit]): F[R, E, Unit]

Attributes

Inherited from:
Applicative3
final override def uninterruptible[R, E, A](r: FreePanic[Nothing, E, A]): FreePanic[S, E, A]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final override def uninterruptibleExcept[R, E, A](r: RestoreInterruption2[[_, _] =>> FreePanic[Nothing, _$94, _$95]] => FreePanic[Nothing, E, A]): FreePanic[S, E, A]

Designate the effect uninterruptible, with exception of regions in it that are specifically marked to restore previous interruptibility status using the provided RestoreInterruption function

Designate the effect uninterruptible, with exception of regions in it that are specifically marked to restore previous interruptibility status using the provided RestoreInterruption function

Attributes

Note:

Interruptibility status will be restored to what it was in the outer region, so if the outer region was also uninterruptible, the provided RestoreInterruption will have no effect. e.g. the expression F.uninterruptible { F.uninterruptibleExcept { restore => restore(F.sleep(1.second)) } is fully uninterruptible throughout

Example:
 F.uninterruptibleExcept {
   restoreInterruption =>
     val workLoop = {
       importantWorkThatMustNotBeInterrupted() *>
       log.info("Taking a break for a second, you can interrupt me while I wait!") *>
       restoreInterruption.apply {
         F.sleep(1.second)
          .guaranteeOnInterrupt(_ => log.info("Got interrupted!"))
       } *>
       log.info("No interruptions, going back to work!") *>
       workLoop
     }
     workLoop
 }
Definition Classes
Inherited from:
Panic2Instance
def unit: F[Any, Nothing, Unit]

Attributes

Inherited from:
Applicative3
final def unless[R, E, E1](cond: FreePanic[Nothing, E, Boolean])(ifFalse: => FreePanic[Nothing, E1, Unit])(implicit ev: E <:< E1): F[R, E1, Unit]

Attributes

Inherited from:
Monad3
final def unless[R, E](cond: Boolean)(ifFalse: => FreePanic[Nothing, E, Unit]): F[R, E, Unit]

Attributes

Inherited from:
Applicative3
final override def void[R, E, A](r: FreePanic[Nothing, E, A]): FreePanic[S, E, Unit]

Attributes

Definition Classes
Inherited from:
Panic2Instance
final def when[R, E, E1](cond: FreePanic[Nothing, E, Boolean])(ifTrue: => FreePanic[Nothing, E1, Unit])(implicit ev: E <:< E1): F[R, E1, Unit]

Attributes

Inherited from:
Monad3
final def when[R, E](cond: Boolean)(ifTrue: => FreePanic[Nothing, E, Unit]): F[R, E, Unit]

Attributes

Inherited from:
Applicative3
final def widen[R, E, A, A1](r: FreePanic[Nothing, E, A])(implicit ev: A <:< A1): F[R, E, A1]

Attributes

Inherited from:
Functor3
final def widenBoth[R, E, A, E1, A1](r: FreePanic[Nothing, E, A])(implicit ev: E <:< E1, ev2: A <:< A1): F[R, E1, A1]

Attributes

Inherited from:
Bifunctor3
final def widenError[R, E, A, E1](r: FreePanic[Nothing, E, A])(implicit ev: E <:< E1): F[R, E1, A]

Attributes

Inherited from:
Bifunctor3
final def withFilter[R, E, A](r: FreePanic[Nothing, E, A])(predicate: A => Boolean)(implicit filter: WithFilter[E], pos: SourceFilePositionMaterializer): F[R, E, A]

for-comprehensions sugar:

for-comprehensions sugar:

 for {
   (1, 2) <- F.pure((2, 1))
 } yield ()

Use widenError to for pattern matching with non-Throwable errors:

 val f = for {
   (1, 2) <- F.pure((2, 1)).widenError[Option[Unit]]
 } yield ()
 // f: F[Option[Unit], Unit] = F.fail(Some(())

Attributes

Inherited from:
Error3