LanguageExt.Core

LanguageExt.Core Thunks

Contents

class Thunk Source #

Methods

method ThunkAsync<Env, A> Flatten <Env, A> (this ThunkAsync<Env, ThunkAsync<Env, A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync<Env, A> Flatten <Env, A> (this ThunkAsync<ThunkAsync<Env, A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync<Env, A> Flatten <Env, A> (this ThunkAsync<Thunk<Env, A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync<Env, A> Flatten <Env, A> (this Thunk<ThunkAsync<Env, A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync<Env, A> Flatten <Env, A> (this ThunkAsync<Env, ThunkAsync<A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync<Env, A> Flatten <Env, A> (this ThunkAsync<Env, Thunk<Env, A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync<Env, A> Flatten <Env, A> (this Thunk<Env, ThunkAsync<Env, A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync<Env, A> Flatten <Env, A> (this ThunkAsync<Env, Thunk<A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync<Env, A> Flatten <Env, A> (this Thunk<Env, ThunkAsync<A>> mma) Source #

where Env : struct, HasCancel<Env>

method ThunkAsync< A> Flatten <A> (this ThunkAsync<ThunkAsync<A>> mma) Source #

method ThunkAsync<A> Flatten <A> (this ThunkAsync<Thunk<A>> mma) Source #

method ThunkAsync<A> Flatten <A> (this Thunk<ThunkAsync<A>> mma) Source #

method Thunk<Env, A> Flatten <Env, A> (this Thunk<Env, Thunk<Env, A>> mma) Source #

method Thunk<Env, A> Flatten <Env, A> (this Thunk<Thunk<Env, A>> mma) Source #

method Thunk<Env, A> Flatten <Env, A> (this Thunk<Env, Thunk<A>> mma) Source #

method Thunk<A> Flatten <A> (this Thunk<Thunk<A>> mma) Source #

class ThunkAsync <A> Source #

Lazily evaluates an asynchronous function and then memoizes the value Runs at most once

Methods

method ThunkAsync<A> Lazy (Func<ValueTask<Fin<A>>> fun) Source #

Construct a lazy thunk

method ThunkAsync<A> Lazy (Func<ValueTask<A>> fun) Source #

Construct a lazy ThunkAsync

method ThunkAsync<A> Fail (Error error) Source #

Construct an error ThunkAsync

method ThunkAsync<A> Success (A value) Source #

Construct a success thunk

method ThunkAsync<A> Cancelled () Source #

Construct a cancelled thunk

method ThunkAsync<A> Clone () Source #

Clone the thunk

For thunks that were created as pre-failed/pre-cancelled values (i.e. no delegate to run, just in a pure error state), then the clone will copy that state exactly. For thunks that have been evaluated then a cloned thunk will reset the thunk to a non-evaluated state. This also means any thunk that has been evaluated and failed would lose the failed status

Parameters

returns

method ValueTask<Fin<A>> Value () Source #

Value accessor

method ValueTask<Fin<A>> ReValue () Source #

Value accessor (clearing the memoised value)

method ThunkAsync<B> Map <B> (Func<A, B> f) Source #

Functor map

method ThunkAsync<B> BiMap <B> (Func<A, B> Succ, Func<Error, Error> Fail) Source #

Functor map

method ThunkAsync<B> MapAsync <B> (Func<A, ValueTask<B>> f) Source #

Functor map

method ThunkAsync<B> BiMapAsync <B> (Func<A, ValueTask<B>> Succ, Func<Error, ValueTask<Error>> Fail) Source #

Functor map

method string ToString () Source #

class ThunkAsync <Env, A> Source #

where Env : struct, HasCancel<Env>

Lazily evaluates an asynchronous function and then memoizes the value Runs at most once

Methods

method ThunkAsync<Env, A> Lazy (Func<Env, ValueTask<Fin<A>>> fun) Source #

Construct a lazy thunk

method ThunkAsync<Env, A> Lazy (Func<Env, ValueTask<A>> fun) Source #

Construct a lazy ThunkAsync

method ThunkAsync<Env, A> Fail (Error error) Source #

Construct an error ThunkAsync

method ThunkAsync<Env, A> Success (A value) Source #

Construct a success thunk

method ThunkAsync<Env, A> Cancelled () Source #

Construct a cancelled thunk

method ValueTask<Fin<A>> Value (Env env) Source #

Value accessor

method ValueTask<Fin<A>> ReValue (Env env) Source #

Value accessor (clearing the memoised value)

method ThunkAsync<Env, A> Clone () Source #

Clone the thunk

For thunks that were created as pre-failed/pre-cancelled values (i.e. no delegate to run, just in a pure error state), then the clone will copy that state exactly. For thunks that have been evaluated then a cloned thunk will reset the thunk to a non-evaluated state. This also means any thunk that has been evaluated and failed would lose the failed status

Parameters

returns

method ThunkAsync<Env, B> Map <B> (Func<A, B> f) Source #

Functor map

method ThunkAsync<Env, B> BiMap <B> (Func<A, B> Succ, Func<Error, Error> Fail) Source #

Functor map

method ThunkAsync<Env, B> MapAsync <B> (Func<A, ValueTask<B>> f) Source #

Functor map

method ThunkAsync<Env, B> BiMapAsync <B> (Func<A, ValueTask<B>> Succ, Func<Error, ValueTask<Error>> Fail) Source #

Functor map

method string ToString () Source #

class Thunk <A> Source #

Lazily evaluates an asynchronous function and then memoizes the value Runs at most once

Methods

method Thunk<A> Lazy (Func<Fin<A>> fun) Source #

Construct a lazy thunk

method Thunk<A> Fail (Error error) Source #

Construct an error Thunk

method Thunk<A> Success (A value) Source #

Construct a success thunk

method Thunk<A> Cancelled () Source #

Construct a cancelled thunk

method Fin<A> Value () Source #

Value accessor

method Fin<A> ReValue () Source #

Value accessor (clearing the memoised value)

method Thunk<A> Clone () Source #

Clone the thunk

For thunks that were created as pre-failed/pre-cancelled values (i.e. no delegate to run, just in a pure error state), then the clone will copy that state exactly. For thunks that have been evaluated then a cloned thunk will reset the thunk to a non-evaluated state. This also means any thunk that has been evaluated and failed would lose the failed status

Parameters

returns

method Thunk<B> Map <B> (Func<A, B> f) Source #

Functor map

method Thunk<B> BiMap <B> (Func<A, B> Succ, Func<Error, Error> Fail) Source #

Functor map

method string ToString () Source #

class Thunk <Env, A> Source #

Lazily evaluates an asynchronous function and then memoizes the value Runs at most once

Methods

method Thunk<Env, A> Lazy (Func<Env, Fin<A>> fun) Source #

Construct a lazy thunk

method Thunk<Env, A> Fail (Error error) Source #

Construct an error Thunk

method Thunk<Env, A> Success (A value) Source #

Construct a success thunk

method Thunk<Env, A> Cancelled () Source #

Construct a cancelled thunk

method Fin<A> Value (Env env) Source #

Value accessor

method Fin<A> ReValue (Env env) Source #

Value accessor (clearing the memoised value)

method Thunk<Env, A> Clone () Source #

Clone the thunk

For thunks that were created as pre-failed/pre-cancelled values (i.e. no delegate to run, just in a pure error state), then the clone will copy that state exactly. For thunks that have been evaluated then a cloned thunk will reset the thunk to a non-evaluated state. This also means any thunk that has been evaluated and failed would lose the failed status

Parameters

returns

method Thunk<Env, B> Map <B> (Func<A, B> f) Source #

Functor map

method Thunk<Env, B> BiMap <B> (Func<A, B> Succ, Func<Error, Error> Fail) Source #

Functor map

method string ToString () Source #

class ThunkExt Source #

Methods

method ThunkAsync<Env, B> MapAsync <Env, A, B> (this Thunk<Env, A> ma, Func<A, ValueTask<B>> f) Source #

where Env : struct, HasCancel<Env>

Functor async map

method ThunkAsync<Env, B> MapAsync <Env, A, B> (this Thunk<A> ma, Func<A, ValueTask<B>> f) Source #

where Env : struct, HasCancel<Env>

Functor async map

method ThunkAsync<B> MapAsync <A, B> (this Thunk<A> ma, Func<A, ValueTask<B>> f) Source #

Functor async map