Logo Orsak

Orsak Namespace

Type/Module Description

AsyncResult<'a, 'e>

The result of running an effect: a ValueTask of a FSharpResult.

Builder

The eff computation expression, and mkEffect.

Cancellation

Effects that run other effects in a CancellationScope. The environment begins the scope and grows into the environment of the effect, which provides the scope as its ICancellationProvider: so CancellationSource.getToken, Time.delay and the retry delays of Orsak.Resilience see the scope's token, and CancellationSource.cancel cancels only the scope.

CancellationProvider

Creates ICancellationProviders, for an environment that doesn't begin cancellation scopes, such as one in a test. To link a source to a token, use CancellationScope.LinkedTo, which is a provider too; to cancel after a timeout, Cancellation.timeout.

CancellationScope (Module)

Creates the ScopeProviders that begin CancellationScopes.

CancellationScope (Type)

A scope of cancellation: a CancellationTokenSource that is cancelled when the token it is linked to is, and can be cancelled on its own without cancelling that token. Begun by Cancellation.within and Cancellation.timeout, and disposed when their effect ends, so each source lives exactly as long as the effects that use it.

CancellationScopeBuilder (Module)

CancellationScopeBuilder (Type)

CancellationSource

Effects for reading and cancelling the environment's CancellationTokenSource.

DefaultRandom

An IRandomGenerator backed by a Random.

Effect (Module)

Functions for running, combining, recovering and repeating effects.

Effect (Type)

Creates effects. Effect.Create turns a function of an environment into an effect, and is how effects are made from the interfaces that describe side effects. The function may return a plain value, a Result, a Task, a ValueTask or an Async, of a value or of a Result; returning a Result lets the effect fail.

Effect<'r, 'a, 'e>

Describes an effect that can either succeed with , or fail with . The effect is 'cold', and only starts when run with an .

EffectDelegate<'r, 'a, 'e>

The function an Effect wraps: given an environment, it starts the effect.

EffectList<'r, 'a, 'e>

An effect that produces a list, as built by the effList computation expression.

EffectListBuilder

The effList computation expression.

EffectSeqDelegate<'r, 'a, 'e>

The function an EffSeq wraps: given an environment, it creates the sequence.

EffSeq

Creates effect sequences, EffSeq.

EffSeq<'r, 'a, 'e>

An effectful stream: like Effect, it requires an environment to start, but it produces a sequence of over time, as an async enumerable, and can fail with . Written with the effSeq computation expression.

EffSeqBuilder

The effSeq computation expression.

GuidGenerator

Effects for generating Guids through an IGuidGenProvider.

ICacheProvider

Provides an IMemoryCache to effects, as part of an environment.

ICancellationProvider

Provides a CancellationTokenSource to effects, as part of an environment.

IGuidGenerator

Generates Guids. An effect interface, so that code creating ids can be run with a deterministic generator in tests.

IGuidGenProvider

Provides an IGuidGenerator to effects, as part of an environment.

ILoggerProvider

Provides an ILogger to effects, as part of an environment.

IProvide<'t>

A marker for an environment that provides an effect of type . An interface marked with [<GenRunner>] from Orsak.Myriad lists the effects its environment provides by inheriting this.

IRandom

Generates random numbers. An effect interface, so that code using randomness can be run with a seeded or fixed generator in tests.

IRandomGenerator

An alias of IRandom.

IRandomGeneratorProvider

Provides an IRandomGenerator to effects, as part of an environment.

IRandomProvider

ITimeProvider

Provides a TimeProvider to effects, as part of an environment. Using TimeProvider.System in production and a fake time provider in tests makes time-dependent effects testable.

Log

Effects for logging with the environment's ILogger, through an ILoggerProvider. Messages are templates, with arguments, as in LoggerExtensions.

MemoryCache

Effects for caching values in the environment's IMemoryCache.

Random

Effects for generating random numbers through an IRandomProvider.

Time

Effects for reading the time, and waiting, through an ITimeProvider.

Type something to start searching.