LanguageExt.Rx

LanguageExt.Rx

Contents

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 : 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 : 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 : 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 EffRxExtensions Source #

Methods

method Eff<Unit> Consume <A> ( this IObservable<A> ma, Func<A, Eff<Unit>> next) 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 Eff<S> Fold <S, A> (this IObservable<A> ma, S initialState, Func<S, A, Eff<S>> next) 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

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 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 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 ValidationRxExtensions Source #

Methods

method IObservable<R2> MatchObservable <F, A, R2> ( this Validation<F, A> ma, Func<A, IObservable<R2>> Succ, Func<F, R2> Fail) Source #

where F : Monoid<F>, Eq<F>

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

method IObservable<R2> MatchObservable <F, A, R2> ( this Validation<F, A> ma, Func<A, IObservable<R2>> Succ, Func<F, IObservable<R2>> Fail) Source #

where F : Monoid<F>, Eq<F>

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