class Panic2Instance[S[_, _]] extends Panic2[[+β$18$, +γ$19$]FreePanic[S, β$18$, γ$19$]]
- Alphabetic
- By Inheritance
- Panic2Instance
- Panic2
- PanicSyntax
- Bracket2
- Error2
- ErrorAccumulatingOps2
- Monad2
- ApplicativeError2
- Bifunctor2
- Guarantee2
- Applicative2
- Functor2
- RootBifunctor
- Root
- PredefinedHelper
- DivergenceHelper
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Panic2Instance()
Type Members
- type Divergence = Nondivergent
- Definition Classes
- DivergenceHelper
- type IsPredefined = NotPredefined
- Definition Classes
- PredefinedHelper
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def *>[E, A, B](f: FreePanic[S, E, A], next: => FreePanic[S, 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
- Definition Classes
- Panic2Instance → Monad2 → Applicative2
- Annotations
- @inline()
- final def <*[E, A, B](f: FreePanic[S, E, A], next: => FreePanic[S, E, B]): FreePanic[S, E, A]
execute two operations in order, same as
*>
, but return result of first operationexecute two operations in order, same as
*>
, but return result of first operation- Definition Classes
- Panic2Instance → Monad2 → Applicative2
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def InnerF: Functor2[[+β$18$, +γ$19$]FreePanic[S, β$18$, γ$19$]]
- Definition Classes
- ApplicativeError2 → Bifunctor2
- def accumulateErrorsImpl[ColL[_], ColR[x] <: IterableOnce[x], E, E1, A, B, B1, AC](col: ColR[A])(effect: (A) => FreePanic[S, E, B], onLeft: (E) => IterableOnce[E1], init: AC, onRight: (AC, B) => AC, end: (AC) => B1)(implicit buildL: Factory[E1, ColL[E1]]): FreePanic[S, ColL[E1], B1]
- Attributes
- protected
- Definition Classes
- ErrorAccumulatingOps2
- final def as[E, A, B](r: FreePanic[S, E, A])(v: => B): FreePanic[S, E, B]
- Definition Classes
- Panic2Instance → Functor2
- Annotations
- @inline()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attempt[E, A](r: FreePanic[S, E, A]): FreePanic[S, Nothing, Either[E, A]]
- Definition Classes
- Error2
- def bimap[E, A, E2, B](r: FreePanic[S, E, A])(f: (E) => E2, g: (A) => B): FreePanic[S, E2, B]
- Definition Classes
- Error2 → Bifunctor2
- def bracket[E, A, B](acquire: FreePanic[S, E, A])(release: (A) => FreePanic[S, Nothing, Unit])(use: (A) => FreePanic[S, E, B]): FreePanic[S, E, B]
- Definition Classes
- Bracket2
- final def bracketCase[E, A, B](acquire: FreePanic[S, E, A])(release: (A, Exit[E, B]) => FreePanic[S, Nothing, Unit])(use: (A) => FreePanic[S, E, B]): FreePanic[S, E, B]
- Definition Classes
- Panic2Instance → Bracket2
- Annotations
- @inline()
- final def bracketExcept[E, A, B](acquire: (RestoreInterruption2[[+β$22$, +γ$23$]FreePanic[S, β$22$, γ$23$]]) => FreePanic[S, E, A])(release: (A, Exit[E, B]) => FreePanic[S, Nothing, Unit])(use: (A) => FreePanic[S, E, B]): FreePanic[S, E, B]
Like bracketCase, but
acquire
can contain marked interruptible regions as in uninterruptibleExceptLike bracketCase, but
acquire
can contain marked interruptible regions as in uninterruptibleExcept- Definition Classes
- Panic2Instance → Panic2
- Annotations
- @inline()
- final def bracketOnFailure[E, A, B](acquire: FreePanic[S, E, A])(cleanupOnFailure: (A, Failure[E]) => FreePanic[S, Nothing, Unit])(use: (A) => FreePanic[S, E, B]): FreePanic[S, E, B]
Run release action only on a failure – _any failure_, INCLUDING interruption.
Run release action only on a failure – _any failure_, INCLUDING interruption. Do not run release action if
use
finished successfully.- Definition Classes
- Bracket2
- final def catchAll[E, A, E2](r: FreePanic[S, E, A])(f: (E) => FreePanic[S, E2, A]): FreePanic[S, E2, A]
- Definition Classes
- Panic2Instance → Error2
- Annotations
- @inline()
- final def catchSome[E, A, E1 >: E](r: FreePanic[S, E, A])(f: PartialFunction[E, FreePanic[S, E1, A]]): FreePanic[S, E1, A]
- Definition Classes
- Panic2Instance → Error2
- Annotations
- @inline()
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collect[E, A, B](l: Iterable[A])(f: (A) => FreePanic[S, E, Option[B]]): FreePanic[S, E, List[B]]
- Definition Classes
- Applicative2
- def collectFirst[E, A, B](l: Iterable[A])(f: (A) => FreePanic[S, E, Option[B]]): FreePanic[S, E, Option[B]]
- Definition Classes
- Monad2
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def fail[E](v: => E): FreePanic[S, E, Nothing]
- Definition Classes
- Panic2Instance → ApplicativeError2
- Annotations
- @inline()
- def filter[E, A](l: Iterable[A])(f: (A) => FreePanic[S, E, Boolean]): FreePanic[S, E, List[A]]
- Definition Classes
- Applicative2
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def find[E, A](l: Iterable[A])(f: (A) => FreePanic[S, E, Boolean]): FreePanic[S, E, Option[A]]
- Definition Classes
- Monad2
- final def flatMap[E, A, B](r: FreePanic[S, E, A])(f: (A) => FreePanic[S, E, B]): FreePanic[S, E, B]
- Definition Classes
- Panic2Instance → Monad2
- Annotations
- @inline()
- def flatSequence[E, A](l: Iterable[FreePanic[S, E, Iterable[A]]]): FreePanic[S, E, List[A]]
- Definition Classes
- Applicative2
- def flatSequenceAccumErrors[ColR[x] <: IterableOnce[x], ColIn[x] <: IterableOnce[x], ColL[_], E, A](col: ColR[FreePanic[S, ColL[E], ColIn[A]]])(implicit buildR: Factory[A, ColR[A]], buildL: Factory[E, ColL[E]], iterL: (ColL[E]) => IterableOnce[E]): FreePanic[S, ColL[E], ColR[A]]
flatSequence
with error accumulationflatSequence
with error accumulation- Definition Classes
- ErrorAccumulatingOps2
- def flatTraverse[E, A, B](l: Iterable[A])(f: (A) => FreePanic[S, E, Iterable[B]]): FreePanic[S, E, List[B]]
- Definition Classes
- Applicative2
- def flatTraverseAccumErrors[ColR[x] <: IterableOnce[x], ColIn[x] <: IterableOnce[x], ColL[_], E, A, B](col: ColR[A])(f: (A) => FreePanic[S, ColL[E], ColIn[B]])(implicit buildR: Factory[B, ColR[B]], buildL: Factory[E, ColL[E]], iterL: (ColL[E]) => IterableOnce[E]): FreePanic[S, ColL[E], ColR[B]]
flatTraverse
with error accumulationflatTraverse
with error accumulation- Definition Classes
- ErrorAccumulatingOps2
- def flatten[E, A](r: FreePanic[S, E, FreePanic[S, E, A]]): FreePanic[S, E, A]
- Definition Classes
- Monad2
- def flip[E, A](r: FreePanic[S, E, A]): FreePanic[S, A, E]
- Definition Classes
- Error2
- def foldLeft[E, A, AC](l: Iterable[A])(z: AC)(f: (AC, A) => FreePanic[S, E, AC]): FreePanic[S, E, AC]
- Definition Classes
- Monad2
- final def forever[E, A](r: FreePanic[S, E, A]): FreePanic[S, E, Nothing]
- Definition Classes
- Applicative2
- Annotations
- @inline()
- final def fromEither[E, V](effect: => Either[E, V]): FreePanic[S, E, V]
- Definition Classes
- Panic2Instance → ApplicativeError2
- Annotations
- @inline()
- final def fromOption[E, A](errorOnNone: => E)(effect: => Option[A]): FreePanic[S, E, A]
- Definition Classes
- Panic2Instance → ApplicativeError2
- Annotations
- @inline()
- def fromOption[E, A](errorOnNone: => E, r: FreePanic[S, E, Option[A]]): FreePanic[S, E, A]
Extracts the optional value or fails with the
errorOnNone
errorExtracts the optional value or fails with the
errorOnNone
error- Definition Classes
- Error2
- def fromOptionF[E, A](fallbackOnNone: => FreePanic[S, E, A], r: FreePanic[S, E, Option[A]]): FreePanic[S, E, A]
Extracts the optional value, or executes the
fallbackOnNone
effectExtracts the optional value, or executes the
fallbackOnNone
effect- Definition Classes
- Monad2
- def fromOptionOr[E, A](valueOnNone: => A, r: FreePanic[S, E, Option[A]]): FreePanic[S, E, A]
Extracts the optional value, or returns the given
valueOnNone
valueExtracts the optional value, or returns the given
valueOnNone
value- Definition Classes
- Functor2
- final def fromTry[A](effect: => Try[A]): FreePanic[S, Throwable, A]
- Definition Classes
- Panic2Instance → ApplicativeError2
- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def guarantee[E, A](f: FreePanic[S, E, A], cleanup: FreePanic[S, Nothing, Unit]): FreePanic[S, E, A]
- Definition Classes
- Panic2Instance → Bracket2 → Guarantee2
- Annotations
- @inline()
- def guaranteeCase[E, A](f: FreePanic[S, E, A], cleanup: (Exit[E, A]) => FreePanic[S, Nothing, Unit]): FreePanic[S, E, A]
- Definition Classes
- Bracket2
- final def guaranteeExceptOnInterrupt[E, A](f: FreePanic[S, E, A], cleanupOnNonInterruption: (Uninterrupted[E, A]) => FreePanic[S, Nothing, Unit]): FreePanic[S, 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.
- Definition Classes
- Bracket2
- final def guaranteeOnFailure[E, A](f: FreePanic[S, E, A], cleanupOnFailure: (Failure[E]) => FreePanic[S, Nothing, Unit]): FreePanic[S, E, A]
Run cleanup only on a failure – _any failure_, INCLUDING interruption.
Run cleanup only on a failure – _any failure_, INCLUDING interruption. Do not run cleanup if
use
finished successfully.- Definition Classes
- Bracket2
- final def guaranteeOnInterrupt[E, A](f: FreePanic[S, E, A], cleanupOnInterruption: (Interruption) => FreePanic[S, Nothing, Unit]): FreePanic[S, E, A]
Run cleanup only on interruption.
Run cleanup only on interruption. Do not run cleanup if
use
finished successfully.- Definition Classes
- Bracket2
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def ifThenElse[E, E1, A](cond: FreePanic[S, E, Boolean])(ifTrue: => FreePanic[S, E1, A], ifFalse: => FreePanic[S, E1, A])(implicit ev: <:<[E, E1]): FreePanic[S, E1, A]
- Definition Classes
- Monad2
- Annotations
- @inline()
- final def ifThenElse[E, A](cond: Boolean)(ifTrue: => FreePanic[S, E, A], ifFalse: => FreePanic[S, E, A]): FreePanic[S, E, A]
- Definition Classes
- Applicative2
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def iterateUntil[E, A](r: FreePanic[S, E, A])(p: (A) => Boolean): FreePanic[S, 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.
- Definition Classes
- Monad2
- def iterateUntilF[E, A](init: A)(f: (A) => FreePanic[S, E, A])(p: (A) => Boolean): FreePanic[S, 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.
- Definition Classes
- Monad2
- def iterateWhile[E, A](r: FreePanic[S, E, A])(p: (A) => Boolean): FreePanic[S, 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.
- Definition Classes
- Monad2
- def iterateWhileF[E, A](init: A)(f: (A) => FreePanic[S, E, A])(p: (A) => Boolean): FreePanic[S, 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.
- Definition Classes
- Monad2
- def leftFlatMap[E, A, E2](r: FreePanic[S, E, A])(f: (E) => FreePanic[S, Nothing, E2]): FreePanic[S, E2, A]
- Definition Classes
- Error2
- def leftMap[E, A, E2](r: FreePanic[S, E, A])(f: (E) => E2): FreePanic[S, E2, A]
- Definition Classes
- Bifunctor2
- def leftMap2[E, A, E2, E3](firstOp: FreePanic[S, E, A], secondOp: => FreePanic[S, E2, A])(f: (E, E2) => E3): FreePanic[S, 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
- Definition Classes
- Error2 → ApplicativeError2
- def map[E, A, B](r: FreePanic[S, E, A])(f: (A) => B): FreePanic[S, E, B]
- def map2[E, A, B, C](r1: FreePanic[S, E, A], r2: => FreePanic[S, E, B])(f: (A, B) => C): FreePanic[S, E, C]
execute two operations in order, map their results
execute two operations in order, map their results
- Definition Classes
- Monad2 → Applicative2
- 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 orElse[E, A, E2](r: FreePanic[S, E, A], f: => FreePanic[S, E2, A]): FreePanic[S, E2, A]
execute second operation only if the first one fails
execute second operation only if the first one fails
- Definition Classes
- Error2 → ApplicativeError2
- final def orTerminate[A](r: FreePanic[S, Throwable, A]): FreePanic[S, Nothing, A]
- Definition Classes
- Panic2
- Annotations
- @inline()
- def partition[E, A](l: Iterable[FreePanic[S, E, A]]): FreePanic[S, Nothing, (List[E], List[A])]
- Definition Classes
- Error2
- Annotations
- @nowarn()
- final def pure[A](a: A): FreePanic[S, Nothing, A]
- Definition Classes
- Panic2Instance → Applicative2
- Annotations
- @inline()
- def redeem[E, A, E2, B](r: FreePanic[S, E, A])(err: (E) => FreePanic[S, E2, B], succ: (A) => FreePanic[S, E2, B]): FreePanic[S, E2, B]
- Definition Classes
- Error2
- def redeemPure[E, A, B](r: FreePanic[S, E, A])(err: (E) => B, succ: (A) => B): FreePanic[S, Nothing, B]
- Definition Classes
- Error2
- def retryUntil[E, A](r: FreePanic[S, E, A])(f: (E) => Boolean): FreePanic[S, E, A]
Retries this effect until its error satisfies the specified predicate.
Retries this effect until its error satisfies the specified predicate.
- Definition Classes
- Error2
- def retryUntilF[E, A](r: FreePanic[S, E, A])(f: (E) => FreePanic[S, Nothing, Boolean]): FreePanic[S, E, A]
Retries this effect until its error satisfies the specified effectful predicate.
Retries this effect until its error satisfies the specified effectful predicate.
- Definition Classes
- Error2
- def retryWhile[E, A](r: FreePanic[S, E, A])(f: (E) => Boolean): FreePanic[S, E, A]
Retries this effect while its error satisfies the specified predicate.
Retries this effect while its error satisfies the specified predicate.
- Definition Classes
- Error2
- def retryWhileF[E, A](r: FreePanic[S, E, A])(f: (E) => FreePanic[S, Nothing, Boolean]): FreePanic[S, E, A]
Retries this effect while its error satisfies the specified effectful predicate.
Retries this effect while its error satisfies the specified effectful predicate.
- Definition Classes
- Error2
- final def sandbox[E, A](r: FreePanic[S, E, A]): FreePanic[S, FailureUninterrupted[E], A]
- Definition Classes
- Panic2Instance → Panic2
- Annotations
- @inline()
- Note
Will return either Exit.Success, Exit.Error or Exit.Termination. Exit.Interruption cannot be sandboxed. Use guaranteeOnInterrupt for cleanups on interruptions.
- final def sandboxExit[E, A](r: FreePanic[S, E, A]): FreePanic[S, Nothing, Uninterrupted[E, A]]
- Definition Classes
- Panic2
- Annotations
- @inline()
- Note
Will return either Exit.Success, Exit.Error or Exit.Termination. Exit.Interruption cannot be sandboxed. Use guaranteeOnInterrupt for cleanups on interruptions.
- final 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.forUnknownError))
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.forUnknownError)) *> 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
- Definition Classes
- Panic2Instance → Panic2
- Annotations
- @inline()
- See also
- https://github.com/zio/interop-cats/issues/503 - History of supporting this method in ZIO
- https://github.com/zio/zio/issues/6911 - related issue
- def sequence[E, A](l: Iterable[FreePanic[S, E, A]]): FreePanic[S, E, List[A]]
- Definition Classes
- Applicative2
- def sequenceAccumErrors[ColR[x] <: IterableOnce[x], ColL[_], E, A](col: ColR[FreePanic[S, ColL[E], A]])(implicit buildR: Factory[A, ColR[A]], buildL: Factory[E, ColL[E]], iterL: (ColL[E]) => IterableOnce[E]): FreePanic[S, ColL[E], ColR[A]]
sequence
with error accumulationsequence
with error accumulation- Definition Classes
- ErrorAccumulatingOps2
- def sequenceAccumErrorsNEList[ColR[x] <: IterableOnce[x], E, A](col: ColR[FreePanic[S, E, A]])(implicit buildR: Factory[A, ColR[A]]): FreePanic[S, NEList[E], ColR[A]]
sequence
with error accumulationsequence
with error accumulation- Definition Classes
- ErrorAccumulatingOps2
- def sequenceAccumErrors_[ColR[x] <: IterableOnce[x], ColL[_], E, A](col: ColR[FreePanic[S, ColL[E], A]])(implicit buildL: Factory[E, ColL[E]], iterL: (ColL[E]) => IterableOnce[E]): FreePanic[S, ColL[E], Unit]
sequence_
with error accumulationsequence_
with error accumulation- Definition Classes
- ErrorAccumulatingOps2
- def sequence_[E](l: Iterable[FreePanic[S, E, Unit]]): FreePanic[S, E, Unit]
- Definition Classes
- Applicative2
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tailRecM[E, A, B](a: A)(f: (A) => FreePanic[S, E, Either[A, B]]): FreePanic[S, E, B]
- Definition Classes
- Monad2
- def tap[E, A](r: FreePanic[S, E, A], f: (A) => FreePanic[S, E, Unit]): FreePanic[S, E, A]
- Definition Classes
- Monad2
- def tapBoth[E, A, E1 >: E](r: FreePanic[S, E, A])(err: (E) => FreePanic[S, E1, Unit], succ: (A) => FreePanic[S, E1, Unit]): FreePanic[S, E1, A]
- Definition Classes
- Error2
- def tapError[E, A, E1 >: E](r: FreePanic[S, E, A])(f: (E) => FreePanic[S, E1, Unit]): FreePanic[S, E1, A]
- Definition Classes
- Error2
- final def terminate(v: => Throwable): FreePanic[S, Nothing, Nothing]
- Definition Classes
- Panic2Instance → Panic2
- Annotations
- @inline()
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def traverse[E, A, B](o: Option[A])(f: (A) => FreePanic[S, E, B]): FreePanic[S, E, Option[B]]
- Definition Classes
- Applicative2
- Annotations
- @inline()
- def traverse[E, A, B](l: Iterable[A])(f: (A) => FreePanic[S, E, B]): FreePanic[S, E, List[B]]
- Definition Classes
- Applicative2
- def traverseAccumErrors[ColR[x] <: IterableOnce[x], ColL[_], E, A, B](col: ColR[A])(f: (A) => FreePanic[S, ColL[E], B])(implicit buildR: Factory[B, ColR[B]], buildL: Factory[E, ColL[E]], iterL: (ColL[E]) => IterableOnce[E]): FreePanic[S, ColL[E], ColR[B]]
traverse
with error accumulationtraverse
with error accumulation- Definition Classes
- ErrorAccumulatingOps2
- def traverseAccumErrors_[ColR[x] <: IterableOnce[x], ColL[_], E, A](col: ColR[A])(f: (A) => FreePanic[S, ColL[E], Unit])(implicit buildL: Factory[E, ColL[E]], iterL: (ColL[E]) => IterableOnce[E]): FreePanic[S, ColL[E], Unit]
traverse_
with error accumulationtraverse_
with error accumulation- Definition Classes
- ErrorAccumulatingOps2
- def traverse_[E, A](l: Iterable[A])(f: (A) => FreePanic[S, E, Unit]): FreePanic[S, E, Unit]
- Definition Classes
- Applicative2
- final def uninterruptible[E, A](r: FreePanic[S, E, A]): FreePanic[S, E, A]
- Definition Classes
- Panic2Instance → Panic2
- Annotations
- @inline()
- final def uninterruptibleExcept[E, A](r: (RestoreInterruption2[[+β$20$, +γ$21$]FreePanic[S, β$20$, γ$21$]]) => FreePanic[S, 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
functionDesignate the effect uninterruptible, with exception of regions in it that are specifically marked to restore previous interruptibility status using the provided
RestoreInterruption
function- Definition Classes
- Panic2Instance → Panic2
- Annotations
- @inline()
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 }
- 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 expressionF.uninterruptible { F.uninterruptibleExcept { restore => restore(F.sleep(1.second)) }
is fully uninterruptible throughout
Example: - def unit: FreePanic[S, Nothing, Unit]
- Definition Classes
- Applicative2
- final def unless[E, E1](cond: FreePanic[S, E, Boolean])(ifFalse: => FreePanic[S, E1, Unit])(implicit ev: <:<[E, E1]): FreePanic[S, E1, Unit]
- Definition Classes
- Monad2
- Annotations
- @inline()
- final def unless[E](cond: Boolean)(ifFalse: => FreePanic[S, E, Unit]): FreePanic[S, E, Unit]
- Definition Classes
- Applicative2
- Annotations
- @inline()
- final def void[E, A](r: FreePanic[S, E, A]): FreePanic[S, E, Unit]
- Definition Classes
- Panic2Instance → Functor2
- Annotations
- @inline()
- 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[E, E1](cond: FreePanic[S, E, Boolean])(ifTrue: => FreePanic[S, E1, Unit])(implicit ev: <:<[E, E1]): FreePanic[S, E1, Unit]
- Definition Classes
- Monad2
- Annotations
- @inline()
- final def when[E](cond: Boolean)(ifTrue: => FreePanic[S, E, Unit]): FreePanic[S, E, Unit]
- Definition Classes
- Applicative2
- Annotations
- @inline()
- final def widen[E, A, A1](r: FreePanic[S, E, A])(implicit ev: <:<[A, A1]): FreePanic[S, E, A1]
- Definition Classes
- Functor2
- Annotations
- @inline()
- final def widenBoth[E, A, E1, A1](r: FreePanic[S, E, A])(implicit ev: <:<[E, E1], ev2: <:<[A, A1]): FreePanic[S, E1, A1]
- Definition Classes
- Bifunctor2
- Annotations
- @inline()
- final def widenError[E, A, E1](r: FreePanic[S, E, A])(implicit ev: <:<[E, E1]): FreePanic[S, E1, A]
- Definition Classes
- Bifunctor2
- Annotations
- @inline()
- final def withFilter[E, A](r: FreePanic[S, E, A])(predicate: (A) => Boolean)(implicit filter: WithFilter[E], pos: SourceFilePositionMaterializer): FreePanic[S, 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(())
- Definition Classes
- Error2
- Annotations
- @inline()