trait MonadCancel[F[_], E] extends MonadError[F, E]
A typeclass that characterizes monads which support safe cancelation, masking, and finalization. MonadCancel extends the capabilities of cats.MonadError, so an instance of this typeclass must also provide a lawful instance for cats.MonadError.
Fibers
A fiber is a sequence of effects which are bound together by flatMap. The execution of a
fiber of an effect F[E, A]
terminates with one of three outcomes, which are encoded by the
datatype Outcome:
- Outcome.Succeeded: indicates success with a value of type
A
- Outcome.Errored: indicates failure with a value of type
E
- Outcome.Canceled: indicates abnormal termination
Additionally, a fiber may never produce an outcome, in which case it is said to be non-terminating.
Cancelation
Cancelation refers to the act of requesting that the execution of a fiber be abnormally terminated. MonadCancel exposes a means of self-cancelation, with which a fiber can request that its own execution be terminated. Self-cancelation is achieved via canceled.
Cancelation is vaguely similar to the short-circuiting behavior introduced by cats.MonadError, but there are several key differences:
- Cancelation is effective; if it is observed it must be respected, and it cannot be reversed. In contrast, handleError exposes the ability to catch and recover from errors, and then proceed with normal execution.
- Cancelation can be masked via MonadCancel!.uncancelable. Masking is discussed in the next section.
- GenSpawn introduces external cancelation, another cancelation mechanism by which fibers can be canceled by external parties.
Masking
Masking allows a fiber to suppress cancelation for a period of time, which is achieved via uncancelable. If a fiber is canceled while it is masked, the cancelation is suppressed for as long as the fiber remains masked. Once the fiber reaches a completely unmasked state, it responds to the cancelation.
While a fiber is masked, it may optionally unmask by "polling", rendering itself cancelable again.
F.uncancelable { poll => // can only observe cancelation within `fb` fa *> poll(fb) *> fc }
These semantics allow users to precisely mark what regions of code are cancelable within a larger code block.
Cancelation Boundaries
A boundary corresponds to an iteration of the internal runloop. In general they are
introduced by any of the combinators from the cats/cats effect hierarchy (map
, flatMap
,
handleErrorWith
, attempt
, etc).
A cancelation boundary is a boundary where the cancelation status of a fiber may be checked and hence cancelation observed. Note that in general you cannot guarantee that cancelation will be observed at a given boundary. However, in the absence of masking it will be observed eventually.
With a small number of exceptions covered below, all boundaries are cancelable boundaries ie cancelation may be observed before the invocation of any combinator.
fa .flatMap(f) .handleErrorWith(g) .map(h)
If the fiber above is canceled then the cancelation status may be checked and the execution terminated between any of the combinators.
As noted above, there are some boundaries which are not cancelable boundaries:
- Any boundary inside
uncancelable
and not insidepoll
. This is the definition of masking as above.
F.uncancelable( _ =>
fa
.flatMap(f)
.handleErrorWith(g)
.map(h)
)
None of the boundaries above are cancelation boundaries as cancelation is masked.
2. The boundary after uncancelable
F.uncancelable(poll => foo(poll)).flatMap(f)
It is guaranteed that we will not observe cancelation after uncancelable
and hence
flatMap(f)
will be invoked. This is necessary for uncancelable
to compose. Consider for
example Resource#allocated
def allocated[B >: A](implicit F: MonadCancel[F, Throwable]): F[(B, F[Unit])]
which returns a tuple of the resource and a finalizer which needs to be invoked to clean-up
once the resource is no longer needed. The implementation of allocated
can make sure it is
safe by appropriate use of uncancelable
. However, if it were possible to observe
cancelation on the boundary directly after allocated
then we would have a leak as the
caller would be unable to ensure that the finalizer is invoked. In other words, the safety of
allocated
and the safety of f
would not guarantee the safety of the composition
allocated.flatMap(f)
.
This does however mean that we violate the functor law that fa.map(identity) <-> fa
as
F.uncancelable(_ => fa).onCancel(fin) <-!-> F.uncancelable(_ => fa).map(identity).onCancel(fin)
as cancelation may be observed before the onCancel
on the RHS. The justification is that
cancelation is a hint rather than a mandate and so enshrining its behaviour in laws will
always be awkward. Given this, it is better to pick a semantic that allows safe composition
of regions.
3. The boundary after poll
F.uncancelable(poll => poll(fa).flatMap(f))
If fa
completes successfully then cancelation may not be observed after poll
but before
flatMap
. The reasoning is similar to above - if fa
has successfully produced a value then
the caller should have the opportunity to observe the value and ensure finalizers are
in-place, etc.
Finalization
Finalization refers to the act of running finalizers in response to a cancelation. Finalizers
are those effects whose evaluation is guaranteed in the event of cancelation. After a fiber
has completed finalization, it terminates with an outcome of Canceled
.
Finalizers can be registered to a fiber for the duration of some effect via onCancel. If a fiber is canceled while running that effect, the registered finalizer is guaranteed to be run before terminating.
Bracket pattern
The aforementioned concepts work together to unlock a powerful pattern for safely interacting with effectful lifecycles: the bracket pattern. This is analogous to the try-with-resources/finally construct in Java.
A lifecycle refers to a pair of actions, which are called the acquisition action and the release action respectively. The relationship between these two actions is that if the former completes successfully, then the latter is guaranteed to be run eventually, even in the presence of errors and cancelation. While the lifecycle is active, other work can be performed, but this invariant is always respected.
The bracket pattern is an invaluable tool for safely handling resource lifecycles. Imagine an application that opens network connections to a database server to do work. If a task in the application is canceled while it holds an open database connection, the connection would never be released or returned to a pool, causing a resource leak.
To illustrate the compositional nature of MonadCancel and its combinators, the implementation of bracket is shown below:
def bracket[A, B](acquire: F[A])(use: A => F[B])(release: A => F[Unit]): F[B] = uncancelable { poll => flatMap(acquire) { a => val finalized = onCancel(poll(use(a)), release(a).uncancelable) val handled = onError(finalized) { case e => void(attempt(release(a).uncancelable)) } flatMap(handled)(b => as(attempt(release(a).uncancelable), b)) } }
See bracketCase and bracketFull for other variants of the bracket pattern. If more specialized behavior is necessary, it is recommended to use uncancelable and onCancel directly.
- Source
- MonadCancel.scala
- Alphabetic
- By Inheritance
- MonadCancel
- MonadError
- Monad
- FlatMap
- FlatMapArityFunctions
- ApplicativeError
- Applicative
- InvariantMonoidal
- Apply
- ApplyArityFunctions
- InvariantSemigroupal
- Semigroupal
- Functor
- Invariant
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def canceled: F[Unit]
An effect that requests self-cancelation on the current fiber.
An effect that requests self-cancelation on the current fiber.
canceled
has a return type ofF[Unit]
instead ofF[Nothing]
due to execution continuing in a masked region. In the following example, the fiber requests self-cancelation in a masked region, so cancelation is suppressed until the fiber is completely unmasked.fa
will run butfb
will not. Ifcanceled
had a return type ofF[Nothing]
, then it would not be possible to continue execution tofa
(there would be noNothing
value to pass to theflatMap
).F.uncancelable { _ => F.canceled *> fa } *> fb
- abstract def flatMap[A, B](fa: F[A])(f: (A) => F[B]): F[B]
- Definition Classes
- FlatMap
- abstract def forceR[A, B](fa: F[A])(fb: F[B]): F[B]
Analogous to productR, but suppresses short-circuiting behavior except for cancelation.
- abstract def handleErrorWith[A](fa: F[A])(f: (E) => F[A]): F[A]
- Definition Classes
- ApplicativeError
- abstract def onCancel[A](fa: F[A], fin: F[Unit]): F[A]
Registers a finalizer that is invoked if cancelation is observed during the evaluation of
fa
.Registers a finalizer that is invoked if cancelation is observed during the evaluation of
fa
. If the evaluation offa
completes without encountering a cancelation, the finalizer is unregistered before proceeding.Note that if
fa
is uncancelable (e.g. created via uncancelable) thenfin
won't be fired.F.onCancel(F.uncancelable(_ => F.canceled), fin) <-> F.unit
During finalization, all actively registered finalizers are run exactly once. The order by which finalizers are run is dictated by nesting: innermost finalizers are run before outermost finalizers. For example, in the following program, the finalizer
f1
is run before the finalizerf2
:F.onCancel(F.onCancel(F.canceled, f1), f2)
If a finalizer throws an error during evaluation, the error is suppressed, and implementations may choose to report it via a side channel. Finalizers are always uncancelable, so cannot otherwise be interrupted.
- fa
The effect that is evaluated after
fin
is registered.- fin
The finalizer to register before evaluating
fa
.
- abstract def pure[A](x: A): F[A]
- Definition Classes
- Applicative
- abstract def raiseError[A](e: E): F[A]
- Definition Classes
- ApplicativeError
- abstract def rootCancelScope: CancelScope
Indicates the default "root scope" semantics of the
F
in question.Indicates the default "root scope" semantics of the
F
in question. For types which do not implement auto-cancelation, this value may be set toCancelScope.Uncancelable
, which behaves as if all valuesF[A]
are wrapped in an implicit "outer"uncancelable
which cannot be polled. MostIO
-like types will define this to beCancelable
. - abstract def tailRecM[A, B](a: A)(f: (A) => F[Either[A, B]]): F[B]
- Definition Classes
- FlatMap
- abstract def uncancelable[A](body: (Poll[F]) => F[A]): F[A]
Masks cancelation on the current fiber.
Masks cancelation on the current fiber. The argument to
body
of typePoll[F]
is a natural transformationF ~> F
that enables polling. Polling causes a fiber to unmask within a masked region so that cancelation can be observed again.In the following example, cancelation can be observed only within
fb
and nowhere else:F.uncancelable { poll => fa *> poll(fb) *> fc }
If a fiber is canceled while it is masked, the cancelation is suppressed for as long as the fiber remains masked. Whenever the fiber is completely unmasked again, the cancelation will be respected.
Masks can also be stacked or nested within each other. If multiple masks are active, all masks must be undone so that cancelation can be observed. In order to completely unmask within a multi-masked region the poll corresponding to each mask must be applied to the effect, outermost-first.
F.uncancelable { p1 => F.uncancelable { p2 => fa *> p2(p1(fb)) *> fc } }
The following operations are no-ops:
- Polling in the wrong order
- Subsequent polls when applying the same poll more than once:
poll(poll(fa))
is equivalent topoll(fa)
- Applying a poll bound to one fiber within another fiber
- body
A function which takes a Poll and returns the effect that we wish to make uncancelable.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def *>[A, B](fa: F[A])(fb: F[B]): F[B]
- Definition Classes
- Apply
- Annotations
- @inline()
- final def <*[A, B](fa: F[A])(fb: F[B]): F[A]
- Definition Classes
- Apply
- Annotations
- @inline()
- final def <*>[A, B](ff: F[(A) => B])(fa: F[A]): F[B]
- Definition Classes
- Apply
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def adaptError[A](fa: F[A])(pf: PartialFunction[E, E]): F[A]
- Definition Classes
- MonadError → ApplicativeError
- def ap[A, B](ff: F[(A) => B])(fa: F[A]): F[B]
- Definition Classes
- FlatMap → Apply
- def ap10[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap11[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap12[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap13[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap14[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap15[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap16[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap17[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap18[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap19[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap2[A, B, Z](ff: F[(A, B) => Z])(fa: F[A], fb: F[B]): F[Z]
- Definition Classes
- FlatMap → Apply
- def ap20[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap21[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19], f20: F[A20]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap22[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19], f20: F[A20], f21: F[A21]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap3[A0, A1, A2, Z](f: F[(A0, A1, A2) => Z])(f0: F[A0], f1: F[A1], f2: F[A2]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap4[A0, A1, A2, A3, Z](f: F[(A0, A1, A2, A3) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap5[A0, A1, A2, A3, A4, Z](f: F[(A0, A1, A2, A3, A4) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap6[A0, A1, A2, A3, A4, A5, Z](f: F[(A0, A1, A2, A3, A4, A5) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap7[A0, A1, A2, A3, A4, A5, A6, Z](f: F[(A0, A1, A2, A3, A4, A5, A6) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap8[A0, A1, A2, A3, A4, A5, A6, A7, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def ap9[A0, A1, A2, A3, A4, A5, A6, A7, A8, Z](f: F[(A0, A1, A2, A3, A4, A5, A6, A7, A8) => Z])(f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8]): F[Z]
- Definition Classes
- ApplyArityFunctions
- def as[A, B](fa: F[A], b: B): F[B]
- Definition Classes
- Functor
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attempt[A](fa: F[A]): F[Either[E, A]]
- Definition Classes
- ApplicativeError
- def attemptNarrow[EE <: Throwable, A](fa: F[A])(implicit tag: ClassTag[EE], ev: <:<[EE, E]): F[Either[EE, A]]
- Definition Classes
- ApplicativeError
- def attemptT[A](fa: F[A]): EitherT[F, E, A]
- Definition Classes
- ApplicativeError
- def attemptTap[A, B](fa: F[A])(f: (Either[E, A]) => F[B]): F[A]
- Definition Classes
- MonadError
- def bracket[A, B](acquire: F[A])(use: (A) => F[B])(release: (A) => F[Unit]): F[B]
A pattern for safely interacting with effectful lifecycles.
A pattern for safely interacting with effectful lifecycles.
If
acquire
completes successfully,use
is called. Ifuse
succeeds, fails, or is canceled,release
is guaranteed to be called exactly once.acquire
is uncancelable.release
is uncancelable.use
is cancelable by default, but can be masked.- acquire
the lifecycle acquisition action
- use
the effect to which the lifecycle is scoped, whose result is the return value of this function
- release
the lifecycle release action
- See also
bracketCase for a more powerful variant
Resource for a composable datatype encoding of effectful lifecycles
- def bracketCase[A, B](acquire: F[A])(use: (A) => F[B])(release: (A, Outcome[F, E, B]) => F[Unit]): F[B]
A pattern for safely interacting with effectful lifecycles.
A pattern for safely interacting with effectful lifecycles.
If
acquire
completes successfully,use
is called. Ifuse
succeeds, fails, or is canceled,release
is guaranteed to be called exactly once.acquire
is uncancelable.release
is uncancelable.use
is cancelable by default, but can be masked.- acquire
the lifecycle acquisition action
- use
the effect to which the lifecycle is scoped, whose result is the return value of this function
- release
the lifecycle release action which depends on the outcome of
use
- See also
bracketFull for a more powerful variant
Resource for a composable datatype encoding of effectful lifecycles
- def bracketFull[A, B](acquire: (Poll[F]) => F[A])(use: (A) => F[B])(release: (A, Outcome[F, E, B]) => F[Unit]): F[B]
A pattern for safely interacting with effectful lifecycles.
A pattern for safely interacting with effectful lifecycles.
If
acquire
completes successfully,use
is called. Ifuse
succeeds, fails, or is canceled,release
is guaranteed to be called exactly once.If
use
succeeds the returned valueB
is returned. Ifuse
returns an exception, the exception is returned.acquire
is uncancelable by default, but can be unmasked.release
is uncancelable.use
is cancelable by default, but can be masked.- acquire
the lifecycle acquisition action which can be canceled
- use
the effect to which the lifecycle is scoped, whose result is the return value of this function
- release
the lifecycle release action which depends on the outcome of
use
- def catchNonFatal[A](a: => A)(implicit ev: <:<[Throwable, E]): F[A]
- Definition Classes
- ApplicativeError
- def catchNonFatalEval[A](a: Eval[A])(implicit ev: <:<[Throwable, E]): F[A]
- Definition Classes
- ApplicativeError
- def catchOnly[T >: Null <: Throwable]: CatchOnlyPartiallyApplied[T, F, E]
- Definition Classes
- ApplicativeError
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compose[G[_]](implicit arg0: Applicative[G]): Applicative[[α]F[G[α]]]
- Definition Classes
- Applicative
- def compose[G[_]](implicit arg0: Apply[G]): Apply[[α]F[G[α]]]
- Definition Classes
- Apply
- def compose[G[_]](implicit arg0: Functor[G]): Functor[[α]F[G[α]]]
- Definition Classes
- Functor
- def compose[G[_]](implicit arg0: Invariant[G]): Invariant[[α]F[G[α]]]
- Definition Classes
- Invariant
- def composeApply[G[_]](implicit arg0: Apply[G]): InvariantSemigroupal[[α]F[G[α]]]
- Definition Classes
- InvariantSemigroupal
- def composeContravariant[G[_]](implicit arg0: Contravariant[G]): Contravariant[[α]F[G[α]]]
- Definition Classes
- Functor → Invariant
- def composeContravariantMonoidal[G[_]](implicit arg0: ContravariantMonoidal[G]): ContravariantMonoidal[[α]F[G[α]]]
- Definition Classes
- Applicative
- def composeFunctor[G[_]](implicit arg0: Functor[G]): Invariant[[α]F[G[α]]]
- Definition Classes
- Invariant
- def ensure[A](fa: F[A])(error: => E)(predicate: (A) => Boolean): F[A]
- Definition Classes
- MonadError
- def ensureOr[A](fa: F[A])(error: (A) => E)(predicate: (A) => Boolean): F[A]
- Definition Classes
- MonadError
- 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])
- def flatMap10[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap11[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap12[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap13[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap14[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap15[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap16[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap17[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap18[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap19[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap2[A0, A1, Z](f0: F[A0], f1: F[A1])(f: (A0, A1) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap20[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap21[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19], f20: F[A20])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap22[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19], f20: F[A20], f21: F[A21])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap3[A0, A1, A2, Z](f0: F[A0], f1: F[A1], f2: F[A2])(f: (A0, A1, A2) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap4[A0, A1, A2, A3, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3])(f: (A0, A1, A2, A3) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap5[A0, A1, A2, A3, A4, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4])(f: (A0, A1, A2, A3, A4) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap6[A0, A1, A2, A3, A4, A5, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5])(f: (A0, A1, A2, A3, A4, A5) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap7[A0, A1, A2, A3, A4, A5, A6, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6])(f: (A0, A1, A2, A3, A4, A5, A6) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap8[A0, A1, A2, A3, A4, A5, A6, A7, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7])(f: (A0, A1, A2, A3, A4, A5, A6, A7) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatMap9[A0, A1, A2, A3, A4, A5, A6, A7, A8, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8) => F[Z]): F[Z]
- Definition Classes
- FlatMapArityFunctions
- def flatTap[A, B](fa: F[A])(f: (A) => F[B]): F[A]
- Definition Classes
- FlatMap
- def flatten[A](ffa: F[F[A]]): F[A]
- Definition Classes
- FlatMap
- final def fmap[A, B](fa: F[A])(f: (A) => B): F[B]
- Definition Classes
- Functor
- def foreverM[A, B](fa: F[A]): F[B]
- Definition Classes
- FlatMap
- def fproduct[A, B](fa: F[A])(f: (A) => B): F[(A, B)]
- Definition Classes
- Functor
- def fproductLeft[A, B](fa: F[A])(f: (A) => B): F[(B, A)]
- Definition Classes
- Functor
- def fromEither[A](x: Either[E, A]): F[A]
- Definition Classes
- ApplicativeError
- def fromOption[A](oa: Option[A], ifEmpty: => E): F[A]
- Definition Classes
- ApplicativeError
- def fromTry[A](t: Try[A])(implicit ev: <:<[Throwable, E]): F[A]
- Definition Classes
- ApplicativeError
- def fromValidated[A](x: Validated[E, A]): F[A]
- Definition Classes
- ApplicativeError
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def guarantee[A](fa: F[A], fin: F[Unit]): F[A]
Specifies an effect that is always invoked after evaluation of
fa
completes, regardless of the outcome.Specifies an effect that is always invoked after evaluation of
fa
completes, regardless of the outcome.This function can be thought of as a combination of flatTap, onError, and onCancel.
- fa
The effect that is run after
fin
is registered.- fin
The effect to run in the event of a cancelation or error.
- See also
guaranteeCase for a more powerful variant
Outcome for the various outcomes of evaluation
- def guaranteeCase[A](fa: F[A])(fin: (Outcome[F, E, A]) => F[Unit]): F[A]
Specifies an effect that is always invoked after evaluation of
fa
completes, but depends on the outcome.Specifies an effect that is always invoked after evaluation of
fa
completes, but depends on the outcome.This function can be thought of as a combination of flatTap, onError, and onCancel.
- fa
The effect that is run after
fin
is registered.- fin
A function that returns the effect to run based on the outcome.
- See also
bracketCase for a more powerful variant
Outcome for the various outcomes of evaluation
- def handleError[A](fa: F[A])(f: (E) => A): F[A]
- Definition Classes
- ApplicativeError
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def ifElseM[A](branches: (F[Boolean], F[A])*)(els: F[A]): F[A]
- Definition Classes
- Monad
- def ifF[A](fb: F[Boolean])(ifTrue: => A, ifFalse: => A): F[A]
- Definition Classes
- Functor
- def ifM[B](fa: F[Boolean])(ifTrue: => F[B], ifFalse: => F[B]): F[B]
- Definition Classes
- FlatMap
- def imap[A, B](fa: F[A])(f: (A) => B)(g: (B) => A): F[B]
- Definition Classes
- Functor → Invariant
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def iterateForeverM[A, B](a: A)(f: (A) => F[A]): F[B]
- Definition Classes
- FlatMap
- def iterateUntil[A](f: F[A])(p: (A) => Boolean): F[A]
- Definition Classes
- Monad
- def iterateUntilM[A](init: A)(f: (A) => F[A])(p: (A) => Boolean): F[A]
- Definition Classes
- Monad
- def iterateWhile[A](f: F[A])(p: (A) => Boolean): F[A]
- Definition Classes
- Monad
- def iterateWhileM[A](init: A)(f: (A) => F[A])(p: (A) => Boolean): F[A]
- Definition Classes
- Monad
- def lift[A, B](f: (A) => B): (F[A]) => F[B]
- Definition Classes
- Functor
- def map[A, B](fa: F[A])(f: (A) => B): F[B]
- Definition Classes
- Monad → Applicative → Functor
- def map10[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map11[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map12[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map13[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map14[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map15[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map16[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map17[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map18[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map19[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map2[A, B, Z](fa: F[A], fb: F[B])(f: (A, B) => Z): F[Z]
- Definition Classes
- FlatMap → Apply
- def map20[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map21[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19], f20: F[A20])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map22[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19], f20: F[A20], f21: F[A21])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map2Eval[A, B, Z](fa: F[A], fb: Eval[F[B]])(f: (A, B) => Z): Eval[F[Z]]
- Definition Classes
- FlatMap → Apply
- def map3[A0, A1, A2, Z](f0: F[A0], f1: F[A1], f2: F[A2])(f: (A0, A1, A2) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map4[A0, A1, A2, A3, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3])(f: (A0, A1, A2, A3) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map5[A0, A1, A2, A3, A4, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4])(f: (A0, A1, A2, A3, A4) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map6[A0, A1, A2, A3, A4, A5, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5])(f: (A0, A1, A2, A3, A4, A5) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map7[A0, A1, A2, A3, A4, A5, A6, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6])(f: (A0, A1, A2, A3, A4, A5, A6) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map8[A0, A1, A2, A3, A4, A5, A6, A7, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7])(f: (A0, A1, A2, A3, A4, A5, A6, A7) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def map9[A0, A1, A2, A3, A4, A5, A6, A7, A8, Z](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8) => Z): F[Z]
- Definition Classes
- ApplyArityFunctions
- def mproduct[A, B](fa: F[A])(f: (A) => F[B]): F[(A, B)]
- Definition Classes
- FlatMap
- 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 onError[A](fa: F[A])(pf: PartialFunction[E, F[Unit]]): F[A]
- Definition Classes
- ApplicativeError
- def point[A](a: A): F[A]
- Definition Classes
- InvariantMonoidal
- def product[A, B](fa: F[A], fb: F[B]): F[(A, B)]
- Definition Classes
- FlatMap → Apply → Semigroupal
- def productL[A, B](fa: F[A])(fb: F[B]): F[A]
- Definition Classes
- FlatMap → Apply
- def productLEval[A, B](fa: F[A])(fb: Eval[F[B]]): F[A]
- Definition Classes
- FlatMap
- def productR[A, B](fa: F[A])(fb: F[B]): F[B]
- Definition Classes
- FlatMap → Apply
- def productREval[A, B](fa: F[A])(fb: Eval[F[B]]): F[B]
- Definition Classes
- FlatMap
- def raiseUnless(cond: Boolean)(e: => E): F[Unit]
- Definition Classes
- ApplicativeError
- def raiseWhen(cond: Boolean)(e: => E): F[Unit]
- Definition Classes
- ApplicativeError
- def recover[A](fa: F[A])(pf: PartialFunction[E, A]): F[A]
- Definition Classes
- ApplicativeError
- def recoverWith[A](fa: F[A])(pf: PartialFunction[E, F[A]]): F[A]
- Definition Classes
- ApplicativeError
- def redeem[A, B](fa: F[A])(recover: (E) => B, f: (A) => B): F[B]
- Definition Classes
- ApplicativeError
- def redeemWith[A, B](fa: F[A])(recover: (E) => F[B], bind: (A) => F[B]): F[B]
- Definition Classes
- MonadError
- def replicateA[A](n: Int, fa: F[A]): F[List[A]]
- Definition Classes
- Applicative
- def replicateA_[A](n: Int, fa: F[A]): F[Unit]
- Definition Classes
- Applicative
- def rethrow[A, EE <: E](fa: F[Either[EE, A]]): F[A]
- Definition Classes
- MonadError
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tuple10[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)]
- Definition Classes
- ApplyArityFunctions
- def tuple11[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)]
- Definition Classes
- ApplyArityFunctions
- def tuple12[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)]
- Definition Classes
- ApplyArityFunctions
- def tuple13[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)]
- Definition Classes
- ApplyArityFunctions
- def tuple14[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)]
- Definition Classes
- ApplyArityFunctions
- def tuple15[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)]
- Definition Classes
- ApplyArityFunctions
- def tuple16[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)]
- Definition Classes
- ApplyArityFunctions
- def tuple17[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)]
- Definition Classes
- ApplyArityFunctions
- def tuple18[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)]
- Definition Classes
- ApplyArityFunctions
- def tuple19[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)]
- Definition Classes
- ApplyArityFunctions
- def tuple2[A, B](f1: F[A], f2: F[B]): F[(A, B)]
- Definition Classes
- ApplyArityFunctions
- def tuple20[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)]
- Definition Classes
- ApplyArityFunctions
- def tuple21[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19], f20: F[A20]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)]
- Definition Classes
- ApplyArityFunctions
- def tuple22[A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8], f9: F[A9], f10: F[A10], f11: F[A11], f12: F[A12], f13: F[A13], f14: F[A14], f15: F[A15], f16: F[A16], f17: F[A17], f18: F[A18], f19: F[A19], f20: F[A20], f21: F[A21]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)]
- Definition Classes
- ApplyArityFunctions
- def tuple3[A0, A1, A2](f0: F[A0], f1: F[A1], f2: F[A2]): F[(A0, A1, A2)]
- Definition Classes
- ApplyArityFunctions
- def tuple4[A0, A1, A2, A3](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3]): F[(A0, A1, A2, A3)]
- Definition Classes
- ApplyArityFunctions
- def tuple5[A0, A1, A2, A3, A4](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4]): F[(A0, A1, A2, A3, A4)]
- Definition Classes
- ApplyArityFunctions
- def tuple6[A0, A1, A2, A3, A4, A5](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5]): F[(A0, A1, A2, A3, A4, A5)]
- Definition Classes
- ApplyArityFunctions
- def tuple7[A0, A1, A2, A3, A4, A5, A6](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6]): F[(A0, A1, A2, A3, A4, A5, A6)]
- Definition Classes
- ApplyArityFunctions
- def tuple8[A0, A1, A2, A3, A4, A5, A6, A7](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7]): F[(A0, A1, A2, A3, A4, A5, A6, A7)]
- Definition Classes
- ApplyArityFunctions
- def tuple9[A0, A1, A2, A3, A4, A5, A6, A7, A8](f0: F[A0], f1: F[A1], f2: F[A2], f3: F[A3], f4: F[A4], f5: F[A5], f6: F[A6], f7: F[A7], f8: F[A8]): F[(A0, A1, A2, A3, A4, A5, A6, A7, A8)]
- Definition Classes
- ApplyArityFunctions
- def tupleLeft[A, B](fa: F[A], b: B): F[(B, A)]
- Definition Classes
- Functor
- def tupleRight[A, B](fa: F[A], b: B): F[(A, B)]
- Definition Classes
- Functor
- def unit: F[Unit]
- Definition Classes
- Applicative → InvariantMonoidal
- def unlessA[A](cond: Boolean)(f: => F[A]): F[Unit]
- Definition Classes
- Applicative
- def untilDefinedM[A](foa: F[Option[A]]): F[A]
- Definition Classes
- FlatMap
- def untilM[G[_], A](f: F[A])(cond: => F[Boolean])(implicit G: Alternative[G]): F[G[A]]
- Definition Classes
- Monad
- def untilM_[A](f: F[A])(cond: => F[Boolean]): F[Unit]
- Definition Classes
- Monad
- def unzip[A, B](fab: F[(A, B)]): (F[A], F[B])
- Definition Classes
- Functor
- def void[A](fa: F[A]): F[Unit]
- Definition Classes
- Functor
- def voidError(fu: F[Unit]): F[Unit]
- Definition Classes
- ApplicativeError
- 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()
- def whenA[A](cond: Boolean)(f: => F[A]): F[Unit]
- Definition Classes
- Applicative
- def whileM[G[_], A](p: F[Boolean])(body: => F[A])(implicit G: Alternative[G]): F[G[A]]
- Definition Classes
- Monad
- def whileM_[A](p: F[Boolean])(body: => F[A]): F[Unit]
- Definition Classes
- Monad
- def widen[A, B >: A](fa: F[A]): F[B]
- Definition Classes
- Functor