tofu
package tofu
- Alphabetic
- Public
- All
Type Members
- trait BoundedParallel[F[_]] extends AnyRef
- class CatsDelay extends CatsDelayCE2
- class CatsDelayCE2 extends AnyRef
- trait Delay[F[_]] extends AnyRef
-
trait
ErrorBase extends AnyRef
Base trait for instance search
-
trait
Errors[F[_], E] extends Raise[F, E] with Handle[F, E] with ErrorsTo[F, F, E]
Allows to throw and handle errors of type ${E} in a ${F}.
Allows to throw and handle errors of type ${E} in a ${F}.
- Annotations
- @implicitNotFound( ... )
- class ErrorsBaseInstances extends ErrorsBaseInstances1
- class ErrorsBaseInstances1 extends ErrorsBaseInstances2
- class ErrorsBaseInstances2 extends ErrorsBaseInstances3
- class ErrorsBaseInstances3 extends AnyRef
-
trait
ErrorsTo[F[_], G[_], E] extends Raise[F, E] with HandleTo[F, G, E]
Allows to throw and handle errors of type ${E} in a ${F} transiting to a ${G} when recovering.
Allows to throw and handle errors of type ${E} in a ${F} transiting to a ${G} when recovering. A
G
can either be the same asF
or some "subconstructor" having less errors semantically.- Annotations
- @implicitNotFound( ... )
- trait Fibers[F[_], Exit[_], Fib[_]] extends Race[F]
-
trait
Finally[F[_], Exit[_]] extends Guarantee[F]
Bracket-like typeclass allowing to match exit of the process
Bracket-like typeclass allowing to match exit of the process
- F
effect process
- Exit
structure, describing process exit like
ExitCase
orExit
- trait Fire[F[_]] extends AnyRef
-
trait
Guarantee[F[_]] extends AnyRef
Bracket-like typeclass allowing to understand if operation was succeed
Bracket-like typeclass allowing to understand if operation was succeed
- F
effect process
-
trait
Handle[F[_], E] extends HandleTo[F, F, E] with Restore[F]
Allows to recover after an error of type ${E} in a ${F}.
Allows to recover after an error of type ${E} in a ${F}.
- Annotations
- @implicitNotFound( ... )
-
trait
HandleTo[F[_], G[_], E] extends RestoreTo[F, G]
Allows to recover after an error of type ${E} in a ${F} transiting to a ${G} as a result.
Allows to recover after an error of type ${E} in a ${F} transiting to a ${G} as a result. A
G
can either be the same as aF
or some "subconstructor" having less errors semantically.- Annotations
- @implicitNotFound( ... )
-
trait
Init[F[_], A] extends AnyRef
Initialize value of type A in type F
Initialize value of type A in type F
- F
initialization effect type
- A
result type
- class PerformInterop extends PerformInterop1
- class PerformInterop1 extends PerformInterop2
- class PerformInterop2 extends AnyRef
-
trait
PerformVia[F[_], Cont[_], Cancel] extends WithContext[F, Performer[F, Cont, Cancel]]
- Annotations
- @implicitNotFound( ... )
- trait Performer[F[_], -Cont[_], Cancel] extends AnyRef
-
trait
Pull[F[_], A] extends AnyRef
simply F[A] in a typeclass form
- trait PullInstances extends AnyRef
-
trait
Push[F[_], A] extends AnyRef
simply function A => F[Unit] in a typeclass form
- trait PushInstances extends PushInstances1
- trait PushInstances1 extends AnyRef
- trait Race[F[_]] extends Fire[F]
-
trait
Raise[F[_], E] extends ErrorBase with ContravariantRaise[F, E]
Allows to raise
E
inside typeF
.Allows to raise
E
inside typeF
.- Annotations
- @implicitNotFound( ... )
-
trait
Restore[F[_]] extends RestoreTo[F, F]
Allows to recover after some error in a ${F}.
Allows to recover after some error in a ${F}.
- Annotations
- @implicitNotFound( ... )
-
trait
RestoreTo[F[_], G[_]] extends Lift[G, F] with ErrorBase
Allows to recover after some error in a ${F} transiting to a ${G} as a result.
Allows to recover after some error in a ${F} transiting to a ${G} as a result. A
G
can either be the same as aF
or some "subconstructor" having less errors semantically.- Annotations
- @implicitNotFound( ... )
-
trait
Scoped[Tag, F[_]] extends AnyRef
can be used for scoped transformations
can be used for scoped transformations
- Tag
arbitrary type tag f type Execute[F[_]] = ScopedExecute[Scoped.Main, F] type Blocks[F[_]] = Scoped[Scoped.Blocking, F] type BlockExec[F[_]] = ScopedExecute[Scoped.Blocking, F] type Calculates[F[_]] = Scoped[Scoped.Calculation, F] type CalcExec[F[_]] = ScopedExecute[Scoped.Calculation, F]or discriminating scopes
- F
process type
- trait ScopedExecute[Tag, F[_]] extends Scoped[Tag, F]
- trait ScopedInstances extends ScopedInstances0
- abstract final class Void extends AnyRef
-
trait
WithContext[F[_], C] extends Context[F]
Synonym for Context with explicit C as Ctx for better type inference
Synonym for Context with explicit C as Ctx for better type inference
There is also a nice type alias:
import tofu.In val fHasMyCtx: MyCtx In F = ???
-
trait
WithLocal[F[_], C] extends Local[F] with WithContext[F, C]
Synonym for Local with explicit C as Ctx for better type inference
-
trait
WithProvide[F[_], G[_], C] extends Provide[F] with Lift[G, F]
Synonym for Provide with explicit
C
asCtx
andG
asLower
for better type inferenceSynonym for Provide with explicit
C
asCtx
andG
asLower
for better type inferenceCan be seen as transformation
F[*] = C => G[*]
-
trait
WithRun[F[_], G[_], C] extends WithProvide[F, G, C] with WithLocal[F, C] with RunContext[F] with Unlift[G, F]
Synonym for both RunContext and Unlift with explicit
C
asCtx
andG
asLower
for better type inferenceSynonym for both RunContext and Unlift with explicit
C
asCtx
andG
asLower
for better type inferenceCan be seen as transformation
F[*] = C => G[*]
-
trait
Context[F[_]] extends ContextBase
Declares that F can provide value of type Ctx
Declares that F can provide value of type Ctx
In other words this trait tells you that F is some kind of Reader or function of type
Ctx => F[A]
. The best way to use it is throughWithContext
orIn
This can be seen as global value for your Application or for a part of it.
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Migrate to With* typeclasses
One common use of this is to make contextual logging:
import tofu.syntax.console._ def contexualConsolling[F[_]: Console: FlatMap](message: String)(implicit hasMyCtx: F HasContext MyCtx): F[Unit] = hasMyCtx.askF(ctx => puts"$message (Also context: $ctx)")
so when you have
MyCtx(3)
the call ofcontextualConsolling("Hi!")
printsHi! (Also MyCtx(3))
Example: -
trait
Local[F[_]] extends Context[F]
Allows to run some computation with notion of altered context consider using
WithLocal
for better type inferenceAllows to run some computation with notion of altered context consider using
WithLocal
for better type inference- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Migrate to With* typeclasses
-
trait
Provide[F[_]] extends ContextBase
Allows to evaluate contextual computation with some context
Allows to evaluate contextual computation with some context
The main use case for it is to obtain some context
Lower[Ctx]
, and then to run another contextual computation F[A] that can useF[Ctx]
inside.- F
context-aware effect e.g.
ReaderT[Lower, Ctx, *]
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Migrate to With* typeclasses
- trait RunContext[F[_]] extends Local[F] with Provide[F]
Value Members
- object BlockExec extends EffectComp[tofu.kernel.types.BlockExec]
- object Blocks extends EffectComp[tofu.kernel.types.Blocks]
- object BoundedParallel extends BoundedParallelInstances0 with EffectComp[BoundedParallel]
- object CalcExec extends EffectComp[tofu.kernel.types.CalcExec]
- object Calculates extends EffectComp[tofu.kernel.types.Calculates]
- object Delay extends CatsDelay with EffectComp[Delay]
- object ErrorBase extends ErrorsBaseInstances
- object Errors extends DataEffectComp[Errors]
- object Execute extends EffectComp[tofu.kernel.types.Execute]
- object Fibers extends Effect3Comp[Fibers]
- object Finally extends Effect2Comp[Finally]
- object Fire extends EffectComp[Fire] with FireInstances0
- object Guarantee extends EffectComp[Guarantee] with GuaranteeInstances0
- object Handle extends DataEffectComp[Handle]
- object PerformOf extends Effect2Comp[tofu.kernel.types.PerformOf]
- object PerformThrow extends EffectComp[tofu.kernel.types.PerformThrow]
- object PerformVia extends PerformInterop
- object Performer
- object Pull extends PullInstances with DataEffectComp[Pull]
- object Push extends PushInstances with DataEffectComp[Push]
- object Race extends EffectComp[Race]
- object Raise extends DataEffectComp[Raise]
- object Scoped extends ScopedInstances
- object Void
-
object
WithContext
Companion object for WithContext
-
object
WithLocal
Companion object for WithLocal
-
object
WithProvide
Companion object for WithProvide
-
object
WithRun
Companion object for WithRun
Deprecated Value Members
-
object
Context
Companion object for Context
Companion object for Context
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Migrate to With* typeclasses
-
object
HasContext
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Use WithContext instead
-
object
HasContextRun
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Use WithRun instead
-
object
HasLocal
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Use WithLocal instead
-
object
HasProvide
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Use WithProvide instead
-
object
Local
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Migrate to With* typeclasses
-
object
Provide
Companion object for Provide
Companion object for Provide
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Migrate to With* typeclasses
-
object
RunContext
Companion object for RunContext
Companion object for RunContext
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.3) Migrate to With* typeclasses