Contents
- EnvIO
- Resources
- Token
- Source
- SyncContext
- New ( Resources? resources = null, CancellationToken token = default, CancellationTokenSource? source = null, SynchronizationContext? syncContext = null)
- LocalResources
- LocalCancel
- LocalSyncContext
- Dispose ()
- ToString ()
- ForkIO <A> (IO<Unit> Cancel, IO<A> Await)
- IO <A> (Func<EnvIO, A> runIO)
- Pure (A value)
- Fail (Error value)
- Empty = new(_ => throw new ManyExceptions([]))
- Lift (Func<A> f)
- Lift (Func<EnvIO, A> f)
- LiftAsync (Func<Task<A>> f)
- LiftAsync (Func<EnvIO, Task<A>> f)
- Map <B> (Func<A, B> f)
- MapFail (Func<Error, Error> f)
- BiMap <B> (Func<A, B> Succ, Func<Error, Error> Fail)
- Match <B> (Func<A, B> Succ, Func<Error, B> Fail)
- IfFail (Func<Error, A> Fail)
- IfFail (A Fail)
- IfFail (Func<Error, IO<A>> Fail)
- IfFail (IO<A> Fail)
- Fold <S> ( Schedule schedule, S initialState, Func<S, A, S> folder)
- Fold <S> ( S initialState, Func<S, A, S> folder)
- FoldWhile <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<S, bool> stateIs)
- FoldWhile <S> ( S initialState, Func<S, A, S> folder, Func<S, bool> stateIs)
- FoldWhile <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<A, bool> valueIs)
- FoldWhile <S> ( S initialState, Func<S, A, S> folder, Func<A, bool> valueIs)
- FoldWhile <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<(S State, A Value), bool> predicate)
- FoldWhile <S> ( S initialState, Func<S, A, S> folder, Func<(S State, A Value), bool> predicate)
- FoldUntil <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<S, bool> stateIs)
- FoldUntil <S> ( S initialState, Func<S, A, S> folder, Func<S, bool> stateIs)
- FoldUntil <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<A, bool> valueIs)
- FoldUntil <S> ( S initialState, Func<S, A, S> folder, Func<A, bool> valueIs)
- FoldUntil <S> ( S initialState, Func<S, A, S> folder, Func<(S State, A Value), bool> predicate)
- FoldUntil <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<(S State, A Value), bool> predicate)
- Post ()
- Bind <B> (Func<A, IO<B>> f)
- Bind <B> (Func<A, K<IO, B>> f)
- Bind <B> (Func<A, Pure<B>> f)
- Select <B> (Func<A, B> f)
- SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- SelectMany <M, B, C> (Func<A, OptionT<M, B>> bind, Func<A, B, C> project)
- SelectMany <M, B, C> (Func<A, TryT<M, B>> bind, Func<A, B, C> project)
- SelectMany <L, M, B, C> (Func<A, EitherT<L, M, B>> bind, Func<A, B, C> project)
- SelectMany <F, M, B, C> (Func<A, ValidationT<F, M, B>> bind, Func<A, B, C> project)
- SelectMany <Env, M, B, C> (Func<A, ReaderT<Env, M, B>> bind, Func<A, B, C> project)
- SelectMany <S, M, B, C> (Func<A, StateT<S, M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Eff<B>> bind, Func<A, B, C> project)
- SelectMany <RT, B, C> (Func<A, Eff<RT, B>> bind, Func<A, B, C> project)
- SelectMany <C> (Func<A, Guard<Error, Unit>> bind, Func<A, Unit, C> project)
- Or (IO<A> mb)
- | (IO<A> ma, IO<A> mb)
- | (IO<A> ma, Pure<A> mb)
- | (IO<A> ma, Fail<Error> mb)
- | (IO<A> ma, Fail<Exception> mb)
- | (IO<A> ma, Error mb)
- | (IO<A> ma, CatchError mb)
- | (IO<A> ma, CatchValue<A> mb)
- | (IO<A> ma, CatchIO<A> mb)
- | (IO<A> ma, CatchM<IO, A> mb)
- | (IO<A> ma, CatchError<Error> mb)
- | (IO<A> ma, CatchError<Exception> mb)
- | (IO<A> ma, CatchValue<Error, A> mb)
- | (IO<A> ma, CatchValue<Exception, A> mb)
- Bracket ()
- Bracket <B, C> (Func<A, IO<C>> Use, Func<A, IO<B>> Finally)
- Bracket <B, C> (Func<A, IO<C>> Use, Func<Error, IO<C>> Catch, Func<A, IO<B>> Finally)
- Timeout (TimeSpan timeout)
- Fork (Option<TimeSpan> timeout = default)
- Run ()
- Run (EnvIO env)
- Try ()
- Repeat ()
- Repeat (Schedule schedule)
- RepeatWhile (Func<A, bool> predicate)
- RepeatWhile ( Schedule schedule, Func<A, bool> predicate)
- RepeatUntil ( Func<A, bool> predicate)
- RepeatUntil ( Schedule schedule, Func<A, bool> predicate)
- Retry ()
- Retry (Schedule schedule)
- RetryWhile (Func<Error, bool> predicate)
- RetryWhile ( Schedule schedule, Func<Error, bool> predicate)
- RetryUntil ( Func<Error, bool> predicate)
- RetryUntil ( Schedule schedule, Func<Error, bool> predicate)
- ToString ()
- IOExtensions
- As <A> (this K<IO, A> ma)
- Run <A> (this K<IO, A> ma, EnvIO envIO)
- Run <A> (this K<IO, A> ma)
- Flatten <A> (this Task<IO<A>> tma)
- Flatten <A> (this IO<IO<A>> mma)
- Await <A> (this K<IO, ForkIO<A>> ma)
- Fork <M, A> (this K<M, A> ma, Option<TimeSpan> timeout = default)
- Apply <A, B> (this IO<Func<A, B>> ff, IO<A> fa)
- Action <A, B> (this IO<A> fa, IO<B> fb)
- IO
- Fail <A> (Error value)
- lift (Action f)
- local <A> (K<IO, A> ma)
- lift <A> (Either<Error, A> ma)
- lift <A> (Fin<A> ma)
- lift <A> (Func<A> f)
- lift <A> (Func<EnvIO, A> f)
- lift <A> (Func<Fin<A>> f)
- lift <A> (Func<EnvIO, Fin<A>> f)
- lift <A> (Func<Either<Error, A>> f)
- lift <A> (Func<EnvIO, Either<Error, A>> f)
- liftAsync <A> (Func<Task<A>> f)
- liftAsync <A> (Func<EnvIO, Task<A>> f)
- env = lift(e => e)
- token = lift(e => e.Token)
- source = lift(e => e.Source)
- syncContext = lift(e => Optional(e.SyncContext))
- bind <A, B> (K<IO, A> ma, Func<A, K<IO, B>> f)
- map <A, B> (Func<A, B> f, K<IO, A> ma)
- map <A, B> (Func<A, B> f, IO<A> ma)
- apply <A, B> (K<IO, Func<A, B>> mf, K<IO, A> ma)
- action <A, B> (K<IO, A> ma, K<IO, B> mb)
- empty <A> ()
- or <A> (K<IO, A> ma, K<IO, A> mb)
- fork <A> (K<IO, A> ma, Option<TimeSpan> timeout = default)
- yield (double milliseconds)
- IO
- Prelude
- cancelToken = IO.lift(e => e.Token)
- cancel = new (e => { e.Source.Cancel(); throw new TaskCanceledException(); })
- unitIO = IO<Unit>.Pure(default)
- envIO = IO<EnvIO>.Lift(e => e)
- local <A> (K<IO, A> ma)
- fork <M, A> (K<M, A> ma, Option<TimeSpan> timeout = default)
- timeout <A> (TimeSpan timeout, K<IO, A> ma)
- repeat <A> (K<IO, A> ma)
- repeat <A> (Schedule schedule, K<IO, A> ma)
- repeatWhile <A> (K<IO, A> ma, Func<A, bool> predicate)
- repeatWhile <A> ( Schedule schedule, K<IO, A> ma, Func<A, bool> predicate)
- repeatUntil <A> ( K<IO, A> ma, Func<A, bool> predicate)
- repeatUntil <A> ( Schedule schedule, K<IO, A> ma, Func<A, bool> predicate)
- retry <A> (K<IO, A> ma)
- retry <A> (Schedule schedule, K<IO, A> ma)
- retryWhile <A> ( K<IO, A> ma, Func<Error, bool> predicate)
- retryWhile <A> ( Schedule schedule, K<IO, A> ma, Func<Error, bool> predicate)
- retryUntil <A> ( K<IO, A> ma, Func<Error, bool> predicate)
- retryUntil <A> ( Schedule schedule, K<IO, A> ma, Func<Error, bool> predicate)
- yield (double milliseconds)
- Resources
Environment for the IO monad
Fields
field SynchronizationContext? SyncContext Source #
Properties
property EnvIO LocalResources Source #
property EnvIO LocalCancel Source #
property EnvIO LocalSyncContext Source #
record ForkIO <A> (IO<Unit> Cancel, IO<A> Await) Source #
Result of forking an IO
monad
Parameters
type | A | Bound value type |
param | Cancel | An |
param | Await | An |
record IO <A> (Func<EnvIO, A> runIO) Source #
A value of type IO
a is a computation which, when performed, does some I/O before returning
a value of type A
.
There is really only one way you should "perform" an I/O action: bind it to Main
in your
program: When your program is run, the I/O will be performed. It shouldn't be possible to
perform I/O from an arbitrary function, unless that function is itself in the IO
monad and
called at some point, directly or indirectly, from Main
.
Obviously, as this is C#, the above restrictions are for you to enforce. It would be reasonable to relax that approach and have I/O invoked from, say, web-request handlers - or any other 'edges' of your application.
IO
is a monad, so IO
actions can be combined using either the LINQ-notation or the bind
operations from the Monad
class.
Parameters
type | A | Bound value |
param | runIO | The lifted thunk that is the IO operation |
Fields
field IO<A> Empty = new(_ => throw new ManyExceptions([])) Source #
Methods
method IO<S> FoldWhile <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<S, bool> stateIs) Source #
method IO<S> FoldWhile <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<A, bool> valueIs) Source #
method IO<S> FoldWhile <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<(S State, A Value), bool> predicate) Source #
method IO<S> FoldWhile <S> ( S initialState, Func<S, A, S> folder, Func<(S State, A Value), bool> predicate) Source #
method IO<S> FoldUntil <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<S, bool> stateIs) Source #
method IO<S> FoldUntil <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<A, bool> valueIs) Source #
method IO<S> FoldUntil <S> ( S initialState, Func<S, A, S> folder, Func<(S State, A Value), bool> predicate) Source #
method IO<S> FoldUntil <S> ( Schedule schedule, S initialState, Func<S, A, S> folder, Func<(S State, A Value), bool> predicate) Source #
Make this IO computation run on the SynchronizationContext
that was captured at the start
of the IO chain (i.e. the one embedded within the EnvIO
environment that is passed through
all IO computations)
method IO<C> SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project) Source #
method IO<C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #
method OptionT<M, C> SelectMany <M, B, C> (Func<A, OptionT<M, B>> bind, Func<A, B, C> project) Source #
method TryT<M, C> SelectMany <M, B, C> (Func<A, TryT<M, B>> bind, Func<A, B, C> project) Source #
method EitherT<L, M, C> SelectMany <L, M, B, C> (Func<A, EitherT<L, M, B>> bind, Func<A, B, C> project) Source #
method ValidationT<F, M, C> SelectMany <F, M, B, C> (Func<A, ValidationT<F, M, B>> bind, Func<A, B, C> project) Source #
method ReaderT<Env, M, C> SelectMany <Env, M, B, C> (Func<A, ReaderT<Env, M, B>> bind, Func<A, B, C> project) Source #
method StateT<S, M, C> SelectMany <S, M, B, C> (Func<A, StateT<S, M, B>> bind, Func<A, B, C> project) Source #
method Eff<C> SelectMany <B, C> (Func<A, Eff<B>> bind, Func<A, B, C> project) Source #
method Eff<RT, C> SelectMany <RT, B, C> (Func<A, Eff<RT, B>> bind, Func<A, B, C> project) Source #
method IO<C> SelectMany <C> (Func<A, Guard<Error, Unit>> bind, Func<A, Unit, C> project) Source #
method IO<A> Bracket () Source #
The IO monad tracks resources automatically, this creates a local resource environment
to run this computation in. Once the computation has completed any resources acquired
are automatically released. Imagine this as the ultimate using
statement.
method IO<C> Bracket <B, C> (Func<A, IO<C>> Use, Func<A, IO<B>> Finally) Source #
When acquiring, using, and releasing various resources, it can be quite convenient to write a function to manage the acquisition and releasing, taking a function of the acquired value that specifies an action to be performed in between.
Parameters
param | Use | Function to use the acquired resource |
param | Finally | Function to invoke to release the resource |
method IO<C> Bracket <B, C> (Func<A, IO<C>> Use, Func<Error, IO<C>> Catch, Func<A, IO<B>> Finally) Source #
When acquiring, using, and releasing various resources, it can be quite convenient to write a function to manage the acquisition and releasing, taking a function of the acquired value that specifies an action to be performed in between.
Parameters
param | Use | Function to use the acquired resource |
param | Catch | Function to run to handle any exceptions |
param | Finally | Function to invoke to release the resource |
method IO<A> Timeout (TimeSpan timeout) Source #
Applies a time limit to the IO computation. If exceeded an exception is thrown.
Parameters
param | timeout | Timeout |
returns | Result of the operation or throws if the time limit exceeded. |
method IO<ForkIO<A>> Fork (Option<TimeSpan> timeout = default) Source #
Queues the specified work to run on the thread pool
Any resources acquired within a forked IO computation will automatically be released upon the forked computation's completion (successful or otherwise). Resources acquired in the parent thread will be available to the forked thread, and can be released from there, but they are shared resources at that point and should be treated with care.
Parameters
param | timeout | Optional timeout |
returns |
|
Run the IO
monad to get its result
Any lifted asynchronous operations will yield to the thread-scheduler, allowing other queued operations to run concurrently. So, even though this call isn't awaitable it still plays nicely and doesn't block the thread.
NOTE: An exception will always be thrown if the IO operation fails. Lift this monad into other error handling monads to leverage more declarative error handling.
Parameters
returns | Result of the IO operation |
method A Run (EnvIO env) Source #
Run the IO
monad to get its result
Any lifted asynchronous operations will yield to the thread-scheduler, allowing other queued operations to run concurrently. So, even though this call isn't awaitable it still plays nicely and doesn't block the thread.
NOTE: An exception will always be thrown if the IO operation fails. Lift this monad into other error handling monads to leverage more declarative error handling.
Parameters
param | env | IO environment |
returns | Result of the IO operation |
method IO<Fin<A>> Try () Source #
Run the IO
monad to get its result. Differs from Run
in that it catches any exceptions and turns
them into a Fin<A>
result.
method IO<A> Repeat () Source #
Keeps repeating the computation forever, or until an error occurs
Any resources acquired within a repeated IO computation will automatically be released. This also means you can't acquire resources and return them from within a repeated computation.
Parameters
returns | The result of the last invocation |
method IO<A> Repeat (Schedule schedule) Source #
Keeps repeating the computation, until the scheduler expires, or an error occurs
Any resources acquired within a repeated IO computation will automatically be released. This also means you can't acquire resources and return them from within a repeated computation.
Parameters
param | schedule | Scheduler strategy for repeating |
returns | The result of the last invocation |
method IO<A> RepeatWhile (Func<A, bool> predicate) Source #
Keeps repeating the computation until the predicate returns false, or an error occurs
Any resources acquired within a repeated IO computation will automatically be released. This also means you can't acquire resources and return them from within a repeated computation.
Parameters
param | predicate | Keep repeating while this predicate returns |
returns | The result of the last invocation |
method IO<A> RepeatWhile ( Schedule schedule, Func<A, bool> predicate) Source #
Keeps repeating the computation, until the scheduler expires, or the predicate returns false, or an error occurs
Any resources acquired within a repeated IO computation will automatically be released. This also means you can't acquire resources and return them from within a repeated computation.
Parameters
param | schedule | Scheduler strategy for repeating |
param | predicate | Keep repeating while this predicate returns |
returns | The result of the last invocation |
method IO<A> RepeatUntil ( Func<A, bool> predicate) Source #
Keeps repeating the computation until the predicate returns true, or an error occurs
Any resources acquired within a repeated IO computation will automatically be released. This also means you can't acquire resources and return them from within a repeated computation.
Parameters
param | predicate | Keep repeating until this predicate returns |
returns | The result of the last invocation |
method IO<A> RepeatUntil ( Schedule schedule, Func<A, bool> predicate) Source #
Keeps repeating the computation, until the scheduler expires, or the predicate returns true, or an error occurs
Any resources acquired within a repeated IO computation will automatically be released. This also means you can't acquire resources and return them from within a repeated computation.
Parameters
param | schedule | Scheduler strategy for repeating |
param | predicate | Keep repeating until this predicate returns |
returns | The result of the last invocation |
method IO<A> Retry () Source #
Retry if the IO computation fails
This variant will retry forever
Any resources acquired within a retrying IO computation will automatically be released if the operation fails. So, successive retries will not grow the acquired resources on each retry iteration. Any successful operation that acquires resources will have them tracked in the usual way.
method IO<A> Retry (Schedule schedule) Source #
Retry if the IO computation fails
This variant will retry until the schedule expires
Any resources acquired within a retrying IO computation will automatically be released if the operation fails. So, successive retries will not grow the acquired resources on each retry iteration. Any successful operation that acquires resources will have them tracked in the usual way.
method IO<A> RetryWhile (Func<Error, bool> predicate) Source #
Retry if the IO computation fails
This variant will keep retrying whilst the predicate returns true
for the error generated at each iteration;
at which point the last raised error will be thrown.
Any resources acquired within a retrying IO computation will automatically be released if the operation fails. So, successive retries will not grow the acquired resources on each retry iteration. Any successful operation that acquires resources will have them tracked in the usual way.
method IO<A> RetryWhile ( Schedule schedule, Func<Error, bool> predicate) Source #
Retry if the IO computation fails
This variant will keep retrying whilst the predicate returns true
for the error generated at each iteration;
or, until the schedule expires; at which point the last raised error will be thrown.
Any resources acquired within a retrying IO computation will automatically be released if the operation fails. So, successive retries will not grow the acquired resources on each retry iteration. Any successful operation that acquires resources will have them tracked in the usual way.
method IO<A> RetryUntil ( Func<Error, bool> predicate) Source #
Retry if the IO computation fails
This variant will keep retrying until the predicate returns true
for the error generated at each iteration;
at which point the last raised error will be thrown.
Any resources acquired within a retrying IO computation will automatically be released if the operation fails. So, successive retries will not grow the acquired resources on each retry iteration. Any successful operation that acquires resources will have them tracked in the usual way.
method IO<A> RetryUntil ( Schedule schedule, Func<Error, bool> predicate) Source #
Retry if the IO computation fails
This variant will keep retrying until the predicate returns true
for the error generated at each iteration;
or, until the schedule expires; at which point the last raised error will be thrown.
Any resources acquired within a retrying IO computation will automatically be released if the operation fails. So, successive retries will not grow the acquired resources on each retry iteration. Any successful operation that acquires resources will have them tracked in the usual way.
Operators
class IOExtensions Source #
Methods
method IO<A> As <A> (this K<IO, A> ma) Source #
Convert the kind version of the IO
monad to an IO
monad.
This is a simple cast operation which is just a bit more elegant than manually casting.
Parameters
type | A | |
param | ma | |
returns |
method IO<A> Flatten <A> (this Task<IO<A>> tma) Source #
Get the outer task and wrap it up in a new IO within the IO
method K<M, ForkIO<A>> Fork <M, A> (this K<M, A> ma, Option<TimeSpan> timeout = default) Source #
Queue this IO operation to run on the thread-pool.
Parameters
param | timeout | Maximum time that the forked IO operation can run for. |
returns | Returns a |
Fields
field IO<EnvIO> env = lift(e => e) Source #
field IO<CancellationToken> token = lift(e => e.Token) Source #
field IO<CancellationTokenSource> source = lift(e => e.Source) Source #
field IO<Option<SynchronizationContext>> syncContext = lift(e => Optional(e.SyncContext)) Source #
Methods
method IO<A> Fail <A> (Error value) Source #
Put the IO into a failure state
Parameters
type | A | Bound value type |
param | value | Error value |
returns | IO in a failed state. Always yields an error. |
method IO<Unit> lift (Action f) Source #
Lift an action into the IO monad
Parameters
param | f | Action to lift |
method IO<A> local <A> (K<IO, A> ma) Source #
Creates a local cancellation environment
A local cancellation environment stops other IO computations, that rely on the same environmental cancellation token, from being taken down by a regional cancellation.
If a IO.cancel
is invoked locally then it will still create an exception that
propagates upwards and so catching cancellations is still important.
Parameters
type | A | Bound value |
param | ma | Computation to run within the local context |
returns | Result of the computation |
method IO<ForkIO<A>> fork <A> (K<IO, A> ma, Option<TimeSpan> timeout = default) Source #
Queue this IO operation to run on the thread-pool.
Parameters
param | timeout | Maximum time that the forked IO operation can run for. |
returns | Returns a |
Fields
field IO<CancellationToken> cancelToken = IO.lift(e => e.Token) Source #
Access the cancellation-token from the IO environment
Parameters
returns | CancellationToken |
field IO<Unit> cancel = new (e => { e.Source.Cancel(); throw new TaskCanceledException(); }) Source #
Request a cancellation of the IO expression
field IO<Unit> unitIO = IO<Unit>.Pure(default) Source #
Always yields a Unit
value
field IO<EnvIO> envIO = IO<EnvIO>.Lift(e => e) Source #
Yields the IO environment
Methods
method IO<A> local <A> (K<IO, A> ma) Source #
Creates a local cancellation environment
A local cancellation environment stops other IO computations, that rely on the same environmental cancellation token, from being taken down by a regional cancellation.
If a IO.cancel
is invoked locally then it will still create an exception that
propagates upwards and so catching cancellations is still important.
Parameters
type | A | Bound value |
param | ma | Computation to run within the local context |
returns | Result of the computation |
method K<M, ForkIO<A>> fork <M, A> (K<M, A> ma, Option<TimeSpan> timeout = default) Source #
Queue this IO operation to run on the thread-pool.
Parameters
param | timeout | Maximum time that the forked IO operation can run for. |
returns | Returns a |
method IO<A> timeout <A> (TimeSpan timeout, K<IO, A> ma) Source #
Timeout operation if it takes too long
method IO<A> repeat <A> (K<IO, A> ma) Source #
Keeps repeating the computation
Parameters
type | A | Computation bound value type |
param | ma | Computation to repeat |
returns | The result of the last invocation of |
method IO<A> repeat <A> (Schedule schedule, K<IO, A> ma) Source #
Keeps repeating the computation, until the scheduler expires
Parameters
type | A | Computation bound value type |
param | schedule | Scheduler strategy for repeating |
param | ma | Computation to repeat |
returns | The result of the last invocation of |
method IO<A> repeatWhile <A> (K<IO, A> ma, Func<A, bool> predicate) Source #
Keeps repeating the computation until the predicate returns false
Parameters
type | A | Computation bound value type |
param | ma | Computation to repeat |
returns | The result of the last invocation of |
method IO<A> repeatWhile <A> ( Schedule schedule, K<IO, A> ma, Func<A, bool> predicate) Source #
Keeps repeating the computation, until the scheduler expires, or the predicate returns false
Parameters
type | A | Computation bound value type |
param | schedule | Scheduler strategy for repeating |
param | ma | Computation to repeat |
returns | The result of the last invocation of |
method IO<A> repeatUntil <A> ( K<IO, A> ma, Func<A, bool> predicate) Source #
Keeps repeating the computation until the predicate returns true
Parameters
type | A | Computation bound value type |
param | ma | Computation to repeat |
returns | The result of the last invocation of |
method IO<A> repeatUntil <A> ( Schedule schedule, K<IO, A> ma, Func<A, bool> predicate) Source #
Keeps repeating the computation, until the scheduler expires, or the predicate returns true
Parameters
type | A | Computation bound value type |
param | schedule | Scheduler strategy for repeating |
param | ma | Computation to repeat |
returns | The result of the last invocation of |
method IO<A> retry <A> (K<IO, A> ma) Source #
Keeps retrying the computation
Parameters
type | A | Computation bound value type |
param | ma | Computation to retry |
returns | The result of the last invocation of ma |
method IO<A> retry <A> (Schedule schedule, K<IO, A> ma) Source #
Keeps retrying the computation, until the scheduler expires
Parameters
type | A | Computation bound value type |
param | schedule | Scheduler strategy for retrying |
param | ma | Computation to retry |
returns | The result of the last invocation of ma |
method IO<A> retryWhile <A> ( K<IO, A> ma, Func<Error, bool> predicate) Source #
Keeps retrying the computation until the predicate returns false
Parameters
type | A | Computation bound value type |
param | ma | Computation to retry |
returns | The result of the last invocation of ma |
method IO<A> retryWhile <A> ( Schedule schedule, K<IO, A> ma, Func<Error, bool> predicate) Source #
Keeps retrying the computation, until the scheduler expires, or the predicate returns false
Parameters
type | A | Computation bound value type |
param | schedule | Scheduler strategy for retrying |
param | ma | Computation to retry |
returns | The result of the last invocation of ma |
method IO<A> retryUntil <A> ( K<IO, A> ma, Func<Error, bool> predicate) Source #
Keeps retrying the computation until the predicate returns true
Parameters
type | A | Computation bound value type |
param | ma | Computation to retry |
returns | The result of the last invocation of ma |
method IO<A> retryUntil <A> ( Schedule schedule, K<IO, A> ma, Func<Error, bool> predicate) Source #
Keeps retrying the computation, until the scheduler expires, or the predicate returns true
Parameters
type | A | Computation bound value type |
param | schedule | Scheduler strategy for retrying |
param | ma | Computation to retry |
returns | The result of the last invocation of ma |
Holds the acquired resources for the ResourceT
monad transformer
Methods
method IO<Unit> ReleaseAll () Source #