- Prelude
- SuccessEff <RT, A> (A value)
- FailEff <RT, A> (Error error)
- runtime <RT> ()
- getState <RT> ()
- localCancel <RT, A> (Eff<RT, A> ma)
- localEff <OuterRT, InnerRT, A> (Func<OuterRT, InnerRT> f, Eff<InnerRT, A> ma)
- flatten <RT, A> (Eff<RT, Eff<RT, A>> mma)
- liftEff <RT, A> (Func<RT, Either<Error, A>> f)
- liftEff <RT, A> (Func<RT, Fin<A>> f)
- liftEff <RT, A> (Func<RT, A> f)
- liftEff <RT, A> (Func<RT, Task<A>> f)
- liftEff <RT, A> (Func<RT, Task<Fin<A>>> f)
- liftEff <RT, A> (IO<A> ma)
- map <RT, A, B> (Eff<RT, A> ma, Func<A, B> f)
- mapFail <RT, A> (Eff<RT, A> ma, Func<Error, Error> f)
- bimap <RT, A, B> (Eff<RT, A> ma, Func<A, B> Succ, Func<Error, Error> Fail)
- match <RT, A, B> (Eff<RT, A> ma, Func<A, B> Succ, Func<Error, B> Fail)
- ifFail <RT, A> (Eff<RT, A> ma, Func<Error, A> Fail)
- ifFailEff <RT, A> (Eff<RT, A> ma, Func<Error, Eff<RT, A>> Fail)
- filter <RT, A> (Eff<RT, A> ma, Func<A, bool> predicate)
- EffMaybe <RT, A> (Func<RT, Fin<A>> f)
- Eff <RT, A> (Func<RT, A> f)
- Prelude
method Eff<RT, A> SuccessEff <RT, A> (A value) Source #
Construct an successful effect with a pure value
type | A | Bound value type |
param | value | Pure value to construct the monad with |
returns | Synchronous IO monad that captures the pure value |
method Eff<RT, A> FailEff <RT, A> (Error error) Source #
Construct a failed effect
type | A | Bound value type |
param | error | Error that represents the failure |
returns | Synchronous IO monad that captures the failure |
method Eff<RT, (RT Runtime, EnvIO EnvIO)> getState <RT> () Source #
Get all of the internal state of the Eff
method Eff<RT, A> localCancel <RT, A> (Eff<RT, A> ma) Source #
Create a new cancellation context and run the provided Aff in that context
type | RT | Runtime environment |
type | A | Bound value type |
param | ma | Operation to run in the next context |
returns | An asynchronous effect that captures the operation running in context |
method Eff<OuterRT, A> localEff <OuterRT, InnerRT, A> (Func<OuterRT, InnerRT> f, Eff<InnerRT, A> ma) Source #
Create a new local context for the environment by mapping the outer environment and then Create a new local context for the environment by mapping the outer environment and then using the result as a new context when running the IO monad provided
param | f | Function to map the outer environment into a new one to run |
param | ma | IO monad to run in the new context |
method Eff<RT, A> flatten <RT, A> (Eff<RT, Eff<RT, A>> mma) Source #
Monadic join operator
Collapses a nested IO monad so there is no nesting.
type | RT | Runtime |
type | E | Error type |
type | A | Bound value |
param | mma | Nest IO monad to flatten |
returns | Flattened IO monad |
method Eff<RT, A> liftEff <RT, A> (Func<RT, Either<Error, A>> f) Source #
Lift an effect into the Eff
monad
method Eff<RT, A> liftEff <RT, A> (Func<RT, Task<Fin<A>>> f) Source #
Lift an effect into the Eff
monad
method Eff<RT, B> map <RT, A, B> (Eff<RT, A> ma, Func<A, B> f) Source #
Maps the IO monad if it's in a success state
param | f | Function to map the success value with |
returns | Mapped IO monad |
method Eff<RT, A> mapFail <RT, A> (Eff<RT, A> ma, Func<Error, Error> f) Source #
Maps the IO monad if it's in a success state
param | f | Function to map the success value with |
returns | Mapped IO monad |
method Eff<RT, B> bimap <RT, A, B> (Eff<RT, A> ma, Func<A, B> Succ, Func<Error, Error> Fail) Source #
Mapping of either the Success state or the Failure state depending on what state this IO monad is in.
param | Succ | Mapping to use if the IO monad is in a success state |
param | Fail | Mapping to use if the IO monad is in a failure state |
returns | Mapped IO monad |
method Eff<RT, B> match <RT, A, B> (Eff<RT, A> ma, Func<A, B> Succ, Func<Error, B> Fail) Source #
Pattern match the success or failure values and collapse them down to a success value
param | Succ | Success value mapping |
param | Fail | Failure value mapping |
returns | IO in a success state |
method Eff<RT, A> ifFail <RT, A> (Eff<RT, A> ma, Func<Error, A> Fail) Source #
Map the failure to a success value
param | f | Function to map the fail value |
returns | IO in a success state |
method Eff<RT, A> ifFailEff <RT, A> (Eff<RT, A> ma, Func<Error, Eff<RT, A>> Fail) Source #
Map the failure to a new IO effect
param | f | Function to map the fail value |
returns | IO that encapsulates that IfFail |
method Eff<RT, A> filter <RT, A> (Eff<RT, A> ma, Func<A, bool> predicate) Source #
Only allow values through the effect if the predicate returns true
for the bound value
param | predicate | Predicate to apply to the bound value> |
returns | Filtered IO |
method Eff<RT, B> map <RT, A, B> (Func<A, B> f, K<Eff<RT>, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Eff<RT, B> action <RT, A, B> (K<Eff<RT>, A> ma, K<Eff<RT>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method Eff<RT, B> apply <RT, A, B> (K<Eff<RT>, Func<A, B>> mf, K<Eff<RT>, A> ma) Source #
Applicative functor apply operation
Unwraps the value within the ma
applicative-functor, passes it to the unwrapped function(s) within mf
, and
then takes the resulting value and wraps it back up into a new applicative-functor.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |