LanguageExt.Rx

LanguageExt.Rx

Contents

class AffRxExtensions Source #

Methods

method Aff<Unit> Consume <A> (this IObservable<A> ma, Func<A, Aff<Unit>> next, CancellationToken token = default) Source #

Consume an observable stream

Each item is passed to the next function. When the stream completes the Aff returns which allows subsequent operations to be composed.

Parameters

type A

Bound type

param ma

Observable to consume

param next

Next function to call

param token

Cancellation token

returns

Aff of unit

method Aff<RT, Unit> Consume <RT, A> (this IObservable<A> ma, Func<A, Aff<RT, Unit>> next) Source #

where RT : struct, HasCancel<RT>

Consume an observable stream

Each item is passed to the next function. When the stream completes the Aff returns which allows subsequent operations to be composed.

Parameters

type A

Bound type

param ma

Observable to consume

param next

Next function to call

returns

Aff of unit

method Aff<S> Fold <S, A> (this IObservable<A> ma, S state, Func<S, A, Aff<S>> next, CancellationToken token = default) Source #

Fold an observable stream

Each item is passed to the next function, with a state value. The state is aggregated over the stream by passing the return value from next to the subsequent calls. When the stream completes, the aggregate state is returned.

Parameters

type A

Bound type

param ma

Observable to fold

param next

Next function to call

param token

Cancellation token

returns

Aff of S

method Aff<RT, S> Fold <RT, S, A> (this IObservable<A> ma, S state, Func<S, A, Aff<RT, S>> next) Source #

where RT : struct, HasCancel<RT>

Fold an observable stream

Each item is passed to the next function, with a state value. The state is aggregated over the stream by passing the return value from next to the subsequent calls. When the stream completes, the aggregate state is returned.

Parameters

type A

Bound type

param ma

Observable to fold

param next

Next function to call

returns

Aff of S

class AtomExtensions Source #

Methods

method IObservable<A> OnChange <A> (this Atom<A> atom) Source #

Observe changes to the Atom

Parameters

type A

Value type

param atom

Atom to observe

returns

Observable atom

method IObservable<A> OnChange <M, A> (this Atom<M, A> atom) Source #

Observe changes to the Atom

Parameters

type A

Value type

param atom

Atom to observe

returns

Observable atom

method IObservable<A> OnChange <A> (this Ref<A> atom) Source #

Observe changes to the Ref

Parameters

type A

Value type

param value

Ref to observe

returns

Observable ref

method IObservable<HashMapPatch<K, V>> OnChange <K, V> (this AtomHashMap<K, V> atom) Source #

Observe changes to the AtomHashMap

This publishes the full patch of a change, which may contain multiple key updates (if done from within a transaction for-example).

Parameters

type A

Value type

param atom

AtomHashMap to observe

returns

Observable AtomHashMap

method IObservable<HashMapPatch<EqK, K, V>> OnChange <EqK, K, V> ( this AtomHashMap<EqK, K, V> atom) Source #

where EqK : struct, Eq<K>

Observe changes to the AtomHashMap

This publishes the full patch of a change, which may contain multiple key updates (if done from within a transaction for-example).

Parameters

type A

Value type

param atom

AtomHashMap to observe

returns

Observable AtomHashMap

method IObservable<(K, Change<V>)> OnEntryChange <K, V> (this AtomHashMap<K, V> atom) Source #

Observe changes to the AtomHashMap

This publishes the changes to individual key-values within the AtomHashMap

Parameters

type A

Value type

returns

Observable (K, Change<V>)

method IObservable<(K, Change<V>)> OnEntryChange <EqK, K, V> (this AtomHashMap<EqK, K, V> atom) Source #

where EqK : struct, Eq<K>

Observe changes to the AtomHashMap

This publishes the changes to individual key-values within the AtomHashMap

Parameters

type A

Value type

returns

Observable (K, Change<V>)

method IObservable<HashMap<EqK, K, V>> OnMapChange <EqK, K, V> (this AtomHashMap<EqK, K, V> atom) Source #

where EqK : struct, Eq<K>

Observe changes to the AtomHashMap

This publishes the latest state of an AtomHashMap

Parameters

type A

Value type

param atom

AtomHashMap to observe

returns

Observable HashMap

class EitherRxExtensions Source #

Methods

method IObservable<R> ToObservable <L, R> (this Either<L, R> ma) Source #

method IObservable<R2> MatchObservable <L, R, R2> (this Either<L, IObservable<R>> self, Func<R, R2> Right, Func<L, R2> Left) Source #

Match the two states of the Either and return a stream of non-null R2s.

method IObservable<R2> MatchObservable <L, R, R2> (this IObservable<Either<L, R>> self, Func<R, R2> Right, Func<L, R2> Left) Source #

Match the two states of the IObservable Either and return a stream of non-null R2s.

method IObservable<R2> MatchObservable <L, R, R2> (this Either<L, R> ma, Func<R, IObservable<R2>> Right, Func<L, R2> Left) Source #

Match the two states of the Either and return an observable stream of non-null R2s.

method IObservable<R2> MatchObservable <L, R, R2> (this Either<L, R> ma, Func<R, IObservable<R2>> Right, Func<L, IObservable<R2>> Left) Source #

Match the two states of the Either and return an observable stream of non-null R2s.

class EitherUnsafeRxExtensions Source #

Methods

method IObservable<R> ToObservable <L, R> (this EitherUnsafe<L, R> ma) Source #

method IObservable<R2> MatchObservable <L, R, R2> (this EitherUnsafe<L, IObservable<R>> self, Func<R, R2> Right, Func<L, R2> Left) Source #

Match the two states of the Either and return a stream of non-null R2s.

method IObservable<R2> MatchObservable <L, R, R2> (this IObservable<EitherUnsafe<L, R>> self, Func<R, R2> Right, Func<L, R2> Left) Source #

Match the two states of the IObservable Either and return a stream of non-null R2s.

method IObservable<R2> MatchObservable <L, R, R2> (this EitherUnsafe<L, R> ma, Func<R, IObservable<R2>> Right, Func<L, R2> Left) Source #

Match the two states of the Either and return an observable stream of non-null R2s.

method IObservable<R2> MatchObservable <L, R, R2> (this EitherUnsafe<L, R> ma, Func<R, IObservable<R2>> Right, Func<L, IObservable<R2>> Left) Source #

Match the two states of the Either and return an observable stream of non-null R2s.

class NullableRxExtensions Source #

Methods

method IObservable<A> ToObservable <A> (this A? ma) Source #

where A : struct

method IObservable<R> MatchObservable <T, R> (this T? self, Func<T, IObservable<R>> Some, Func<R> None) Source #

where T : struct

Match the two states of the Nullable and return an observable stream of Rs.

Parameters

type R

Return type

param Some

Some handler

param None

None handler

returns

A stream of Rs

method IObservable<R> MatchObservable <T, R> (this IObservable<T?> self, Func<T, R> Some, Func<R> None) Source #

where T : struct

Match the two states of the IObservable<Nullable> and return a stream of non-null Rs.

Parameters

type R

Return type

param Some

Some handler

param None

None handler

returns

A stream of Rs

method IObservable<R> MatchObservable <T, R> (this T? self, Func<T, IObservable<R>> Some, Func<IObservable<R>> None) Source #

where T : struct

Match the two states of the Nullable and return an observable stream of Rs.

Parameters

type R

Return type

param Some

Some handler

param None

None handler

returns

A stream of Rs

class OptionRxExtensions Source #

Methods

method IObservable<B> Choose <A, B> (this IObservable<A> ma, Func<A, Option<B>> f) Source #

method IObservable<A> ToObservable <A> (this Option<A> ma) Source #

method IObservable<B> MatchObservable <A, B> (this Option<A> ma, Func<A, IObservable<B>> Some, Func<B> None) Source #

Match the two states of the Option and return an observable stream of non-null Rs.

Parameters

type B

Return type

param Some

Some handler. Must not return null.

param None

None handler. Must not return null.

returns

A stream of non-null Rs

method IObservable<B> MatchObservable <A, B> (this Option<A> ma, Func<A, IObservable<B>> Some, Func<IObservable<B>> None) Source #

Match the two states of the Option and return an observable stream of non-null Rs.

Parameters

type B

Return type

param Some

Some handler. Must not return null.

param None

None handler. Must not return null.

returns

A stream of non-null Rs

class OptionUnsafeRxExtensions Source #

Methods

method IObservable<A> ToObservable <A> (this OptionUnsafe<A> ma) Source #

method IObservable<B> MatchObservable <A, B> (this OptionUnsafe<A> ma, Func<A, IObservable<B>> Some, Func<B> None) Source #

Match the two states of the OptionUnsafe and return an observable stream of non-null Rs.

Parameters

type B

Return type

param Some

Some handler. Must not return null.

param None

None handler. Must not return null.

returns

A stream of non-null Rs

method IObservable<B> MatchObservable <A, B> (this OptionUnsafe<A> ma, Func<A, IObservable<B>> Some, Func<IObservable<B>> None) Source #

Match the two states of the OptionUnsafe and return an observable stream of non-null Rs.

Parameters

type B

Return type

param Some

Some handler. Must not return null.

param None

None handler. Must not return null.

returns

A stream of non-null Rs

class PreludeRx Source #

Methods

method IObservable<T> delay <T> (Func<T> f, TimeSpan delayFor) Source #

Execute a function after a specified delay

Parameters

param f

Function to execute

param delayFor

Time span to delay for

returns

IObservable T with the result

method IObservable<T> delay <T> (Func<T> f, DateTime delayUntil) Source #

Execute a function at a specific time

This will fail to be accurate across a Daylight Saving Time boundary

Parameters

param f

Function to execute

param delayUntil

DateTime to wake up at.

returns

IObservable T with the result

class TaskTryRxExtensions Source #

Methods

method IObservable<R> MatchObservable <A, R> (this Task<Try<A>> self, Func<A, IObservable<R>> Succ, Func<Exception, R> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param self

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this Task<Try<A>> self, Func<A, IObservable<R>> Succ, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param self

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this Task<Try<A>> self, Func<A, R> Succ, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param self

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

class TryRxExtensions Source #

Methods

method IObservable<R> MatchObservable <A, R> (this Try<A> self, Func<A, IObservable<R>> Succ, Func<Exception, R> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param self

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this Try<A> self, Func<A, IObservable<R>> Succ, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param self

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this Try<A> self, Func<A, R> Succ, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param self

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <T, R> (this IObservable<Try<T>> self, Func<T, R> Succ, Func<Exception, R> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<Try<T>> self, Func<T, IObservable<R>> Succ, Func<Exception, R> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<Try<T>> self, Func<T, IObservable<R>> Succ, Func<Exception, IObservable<R>> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<Try<T>> self, Func<T, R> Succ, Func<Exception, IObservable<R>> Fail) Source #

class TryAsyncRxExtensions Source #

Methods

method IObservable<A> ToObservable <A> (this TryAsync<A> ma) Source #

method IObservable<B> MatchObservable <A, B> (this TryAsync<A> ma, Func<A, IObservable<B>> Succ, Func<Exception, B> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type B

Returned observable bound type

param ma

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this TryAsync<A> ma, Func<A, IObservable<R>> Succ, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param ma

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this TryAsync<A> ma, Func<A, R> Succ, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param ma

This

param Succ

Function to call when the operation succeeds

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

class TryOptionRxExtensions Source #

Methods

method IObservable<A> ToObservable <A> (this TryOption<A> ma) Source #

method IObservable<R> MatchObservable <A, R> (this TryOption<A> ma, Func<A, IObservable<R>> Some, Func<R> Fail) Source #

method IObservable<R> MatchObservable <A, R> (this TryOption<A> ma, Func<A, IObservable<R>> Some, Func<R> None, Func<Exception, R> Fail) Source #

method IObservable<R> MatchObservable <A, R> (this TryOption<A> ma, Func<A, IObservable<R>> Some, Func<IObservable<R>> Fail) Source #

method IObservable<R> MatchObservable <A, R> (this TryOption<A> ma, Func<A, IObservable<R>> Some, Func<IObservable<R>> None, Func<Exception, IObservable<R>> Fail) Source #

method IObservable<R> MatchObservable <A, R> (this TryOption<A> ma, Func<A, R> Some, Func<IObservable<R>> Fail) Source #

method IObservable<R> MatchObservable <A, R> (this TryOption<A> ma, Func<A, R> Some, Func<IObservable<R>> None, Func<Exception, IObservable<R>> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<TryOption<T>> self, Func<T, R> Some, Func<R> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<TryOption<T>> self, Func<T, IObservable<R>> Some, Func<R> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<TryOption<T>> self, Func<T, IObservable<R>> Some, Func<IObservable<R>> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<TryOption<T>> self, Func<T, R> Some, Func<IObservable<R>> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<TryOption<T>> self, Func<T, R> Some, Func<R> None, Func<Exception, R> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<TryOption<T>> self, Func<T, IObservable<R>> Some, Func<R> None, Func<Exception, R> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<TryOption<T>> self, Func<T, IObservable<R>> Some, Func<IObservable<R>> None, Func<Exception, IObservable<R>> Fail) Source #

method IObservable<R> MatchObservable <T, R> (this IObservable<TryOption<T>> self, Func<T, R> Some, Func<IObservable<R>> None, Func<Exception, IObservable<R>> Fail) Source #

class TryOptionAsyncRxExtensions Source #

Methods

method IObservable<A> ToObservable <A> (this TryOptionAsync<A> ma) Source #

method IObservable<B> MatchObservable <A, B> (this TryOptionAsync<A> ma, Func<A, IObservable<B>> Some, Func<B> None, Func<Exception, B> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type B

Returned observable bound type

param ma

This

param Some

Function to call when the operation succeeds

param None

Function to call when the operation succeeds but returns no value

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<B> MatchObservable <A, B> (this TryOptionAsync<A> ma, Func<A, IObservable<B>> Some, Func<IObservable<B>> None, Func<Exception, B> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type B

Returned observable bound type

param ma

This

param Some

Function to call when the operation succeeds

param None

Function to call when the operation succeeds but returns no value

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this TryOptionAsync<A> ma, Func<A, IObservable<R>> Some, Func<R> None, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param ma

This

param Some

Function to call when the operation succeeds

param None

Function to call when the operation succeeds but returns no value

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this TryOptionAsync<A> ma, Func<A, IObservable<R>> Some, Func<IObservable<R>> None, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param ma

This

param Some

Function to call when the operation succeeds

param None

Function to call when the operation succeeds but returns no value

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this TryOptionAsync<A> ma, Func<A, R> Some, Func<R> None, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param ma

This

param Some

Function to call when the operation succeeds

param None

Function to call when the operation succeeds but returns no value

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

method IObservable<R> MatchObservable <A, R> (this TryOptionAsync<A> ma, Func<A, R> Some, Func<IObservable<R>> None, Func<Exception, IObservable<R>> Fail) Source #

Turns the computation into an observable stream

Parameters

type A

Bound type

type R

Returned observable bound type

param ma

This

param Some

Function to call when the operation succeeds

param None

Function to call when the operation succeeds but returns no value

param Fail

Function to call when the operation fails

returns

An observable that represents the result of Succ or Fail

class ValidationRxExtensions Source #

Methods

method IObservable<R2> MatchObservable <MonoidFail, FAIL, SUCCESS, R2> (this Validation<MonoidFail, FAIL, SUCCESS> ma, Func<SUCCESS, IObservable<R2>> Succ, Func<FAIL, R2> Fail) Source #

where MonoidFail : struct, Monoid<FAIL>, Eq<FAIL>

Match the two states of the Validation and return an observable stream of non-null R2s.

method IObservable<R2> MatchObservable <MonoidFail, FAIL, SUCCESS, R2> (this Validation<MonoidFail, FAIL, SUCCESS> ma, Func<SUCCESS, IObservable<R2>> Succ, Func<FAIL, IObservable<R2>> Fail) Source #

where MonoidFail : struct, Monoid<FAIL>, Eq<FAIL>

Match the two states of the Validation and return an observable stream of non-null R2s.

class ValidationSeqRxExtensions Source #

Methods

method IObservable<R2> MatchObservable <FAIL, SUCCESS, R2> (this Validation<FAIL, SUCCESS> ma, Func<SUCCESS, IObservable<R2>> Succ, Func<Seq<FAIL>, R2> Fail) Source #

Match the two states of the Validation and return an observable stream of non-null R2s.

method IObservable<R2> MatchObservable <FAIL, SUCCESS, R2> (this Validation<FAIL, SUCCESS> ma, Func<SUCCESS, IObservable<R2>> Succ, Func<Seq<FAIL>, IObservable<R2>> Fail) Source #

Match the two states of the Validation and return an observable stream of non-null R2s.