LanguageExt.Pipes

LanguageExt.Pipes PipeT

Contents

record PipeT <IN, OUT, M, A> Source #

where M : Monad<M>

PipeT monad-transformer base-type for Pipes streaming components:

  • ProducerT is a PipeT with the IN 'closed off' with Unit
  • ConsumerT is a PipeT with the OUT 'closed off' with Void
  • EffectT is a PipeT with the IN and OUT 'closed off' with Unit upstream and Void downstream

Parameters

type IN

Type of values to be consumed

type OUT

Type of values to be produced

type M

Lifted monad type

type A

Bound value type

Methods

method PipeT<IN, OUT1, M, A> Compose <OUT1> (PipeT<OUT, OUT1, M, A> rhs) Source #

method ConsumerT<IN, M, A> Compose (ConsumerT<OUT, M, A> rhs) Source #

method PipeT<IN, OUT, M, B> Map <B> (Func<A, B> f) Source #

method PipeT<IN, OUT, M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #

method PipeT<IN, OUT, M, B> ApplyBack <B> (PipeT<IN, OUT, M, Func<A, B>> ff) Source #

method PipeT<IN, OUT, M, B> Action <B> (PipeT<IN, OUT, M, B> fb) Source #

method PipeT<IN, OUT, M, B> Bind <B> (Func<A, PipeT<IN, OUT, M, B>> f) Source #

method PipeT<IN, OUT, M, B> Bind <B> (Func<A, IO<B>> f) Source #

method PipeT<IN, OUT, M, B> Bind <B> (Func<A, K<M, B>> f) Source #

method PipeT<IN, OUT, M, B> Bind <B> (Func<A, Pure<B>> f) Source #

method PipeT<IN, OUT, M, B> Bind <B> (Func<A, Lift<B>> f) Source #

method PipeT<IN, OUT, M, B> BindAsync <B> (Func<A, ValueTask<PipeT<IN, OUT, M, B>>> f) Source #

method PipeT<IN, OUT, M, B> MapIO <B> (Func<IO<A>, IO<B>> f) Source #

method PipeT<IN, OUT, M, B> Select <B> (Func<A, B> f) Source #

method PipeT<IN, OUT, M, C> SelectMany <B, C> (Func<A, PipeT<IN, OUT, M, B>> f, Func<A, B, C> g) Source #

method PipeT<IN, OUT, M, C> SelectMany <B, C> (Func<A, K<M, B>> f, Func<A, B, C> g) Source #

method PipeT<IN, OUT, M, C> SelectMany <B, C> (Func<A, IO<B>> f, Func<A, B, C> g) Source #

method PipeT<IN, OUT, M, C> SelectMany <B, C> (Func<A, Pure<B>> f, Func<A, B, C> g) Source #

method PipeT<IN, OUT, M, C> SelectMany <B, C> (Func<A, Lift<B>> f, Func<A, B, C> g) Source #

method PipeT<IN, OUT, M, Unit> Fold ( Schedule Time, Func<OUT, A, OUT> Fold, OUT Init) Source #

Fold the given pipe until the Schedule completes. Once complete, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Time

Schedule to run each item

param Fold

Fold function

param Init

Initial state

returns

method PipeT<IN, OUT, M, Unit> FoldUntil ( Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init) Source #

Fold the given pipe until the predicate is true. Once true the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method PipeT<IN, OUT, M, Unit> FoldUntil ( Schedule Time, Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init) Source #

Fold the given pipe until the predicate is true or the Schedule completes. Once true, or completed, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Time

Schedule to run each item

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method PipeT<IN, OUT, M, Unit> FoldWhile ( Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init) Source #

Fold the given pipe while the predicate is true. Once false the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method PipeT<IN, OUT, M, Unit> FoldWhile ( Schedule Time, Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init) Source #

Fold the given pipe while the predicate is true or the Schedule completes. Once false, or completed, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Time

Schedule to run each item

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

Operators

operator | (PipeT<IN, OUT, M, A> lhs, PipeT<OUT, OUT, M, A> rhs) Source #

operator | (ProducerT<IN, M, A> lhs, PipeT<IN, OUT, M, A> rhs) Source #

operator | (PipeT<IN, OUT, M, A> lhs, ConsumerT<OUT, M, A> rhs) Source #

class PipeTExtensions Source #

Methods

method PipeT<IN, OUT, M, A> As <IN, OUT, M, A> (this K<PipeT<IN, OUT, M>, A> ma) Source #

where M : Monad<M>

Downcast

method Pipe<RT, IN, OUT, A> ToEff <RT, IN, OUT, A> (this K<PipeT<IN, OUT, Eff<RT>>, A> ma) Source #

Convert to the Eff version of Pipe

method PipeT<IN, OUT, M, C> SelectMany <IN, OUT, M, A, B, C> ( this K<M, A> ma, Func<A, PipeT<IN, OUT, M, B>> f, Func<A, B, C> g) Source #

where M : Monad<M>

Monad bind

method PipeT<IN, OUT, M, C> SelectMany <IN, OUT, M, A, B, C> ( this IO<A> ma, Func<A, PipeT<IN, OUT, M, B>> f, Func<A, B, C> g) Source #

where M : Monad<M>

Monad bind

method PipeT<IN, OUT, M, C> SelectMany <IN, OUT, M, A, B, C> ( this Pure<A> ma, Func<A, PipeT<IN, OUT, M, B>> f, Func<A, B, C> g) Source #

where M : Monad<M>

Monad bind

method PipeT<IN, OUT, M, C> SelectMany <IN, OUT, M, A, B, C> ( this Lift<A> ff, Func<A, PipeT<IN, OUT, M, B>> f, Func<A, B, C> g) Source #

where M : Monad<M>

Monad bind

method PipeT<IN, OUT, M, B> Bind <IN, OUT, M, A, B> ( this K<M, A> ma, Func<A, PipeT<IN, OUT, M, B>> f) Source #

where M : Monad<M>

Monad bind

method PipeT<IN, OUT, M, B> Bind <IN, OUT, M, A, B> ( this IO<A> ma, Func<A, PipeT<IN, OUT, M, B>> f) Source #

where M : Monad<M>

Monad bind

method PipeT<IN, OUT, M, B> Bind <IN, OUT, M, A, B> ( this Pure<A> ma, Func<A, PipeT<IN, OUT, M, B>> f) Source #

where M : Monad<M>

Monad bind

method PipeT<IN, OUT, M, B> Bind <IN, OUT, M, A, B> ( this Lift<A> ff, Func<A, PipeT<IN, OUT, M, B>> f) Source #

where M : Monad<M>

Monad bind

method PipeT<IN, OUT, M, C> SelectMany <IN, OUT, E, M, A, C> ( this K<PipeT<IN, OUT, M>, A> ma, Func<A, Guard<E, Unit>> bind, Func<A, Unit, C> project) Source #

where M : Monad<M>, Fallible<E, M>

Monad bind operation

method PipeT<IN, OUT, M, C> SelectMany <IN, OUT, E, M, B, C> ( this Guard<E, Unit> ma, Func<Unit, K<PipeT<IN, OUT, M>, B>> bind, Func<Unit, B, C> project) Source #

where M : Monad<M>, Fallible<E, M>

Monad bind operation

class PipeT Source #

PipeT streaming producer monad-transformer

Methods

method PipeT<IN, OUT, M, Unit> yield <M, IN, OUT> (OUT value) Source #

where M : Monad<M>

Yield a value downstream

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

returns

method PipeT<IN, OUT, M, Unit> yieldAll <M, IN, OUT> (IEnumerable<OUT> values) Source #

where M : Monad<M>

Yield all values downstream

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

returns

method PipeT<IN, OUT, M, Unit> yieldAll <M, IN, OUT> (IAsyncEnumerable<OUT> values) Source #

where M : Monad<M>

Yield all values downstream

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

returns

method PipeT<IN, OUT, M, Unit> yieldRepeat <M, IN, OUT> (K<M, OUT> ma) Source #

where M : Monad<M>

Evaluate the M monad repeatedly, yielding its bound values downstream

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

returns

method PipeT<IN, OUT, M, Unit> yieldRepeatIO <M, IN, OUT> (IO<OUT> ma) Source #

where M : Monad<M>

Evaluate the IO monad repeatedly, yielding its bound values downstream

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

returns

method PipeT<IN, OUT, M, IN> awaiting <M, IN, OUT> () Source #

where M : Monad<M>

Await a value from upstream

Parameters

type M

Lifted monad type

type IN

Stream value to consume

type OUT

Stream value to produce

returns

Pipe

method PipeT<A, A, M, Unit> filter <M, A> (Func<A, bool> f) Source #

where M : Monad<M>

Create a pipe that filters out values that return false when applied to a predicate function

Parameters

type M

Lifted monad type

type A

Stream value to consume and produce

param f

Predicate function

returns

Pipe

method PipeT<IN, OUT, M, Unit> map <M, IN, OUT> (Func<IN, OUT> f) Source #

where M : Monad<M>

Create a pipe from a mapping function

Parameters

type M

Lifted monad type

type IN

Stream value to consume

type OUT

Stream value to produce

param f

Mapping function

returns

Pipe

method PipeT<IN, OUT, M, Unit> mapM <M, IN, OUT> (Func<IN, K<M, OUT>> f) Source #

where M : Monad<M>

Create a pipe from a mapping function

Parameters

type M

Lifted monad type

type IN

Stream value to consume

type OUT

Stream value to produce

param f

Mapping function

returns

Pipe

method PipeT<IN, OUT, M, A> pure <IN, OUT, M, A> (A value) Source #

where M : Monad<M>

Create a pipe that simply returns a bound value without yielding anything

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> fail <IN, OUT, E, M, A> (E value) Source #

where M : Monad<M>, Fallible<E, M>

Create a pipe that always fails

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type E

Failure type

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> error <IN, OUT, M, A> (Error value) Source #

where M : Monad<M>, Fallible<M>

Create a pipe that always fails

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> empty <IN, OUT, M, A> () Source #

where M : Monad<M>, MonoidK<M>

Create a pipe that yields nothing at all

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> lift <IN, OUT, M, A> (Func<A> f) Source #

where M : Monad<M>

Create a pipe that simply returns a bound value without yielding anything

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> liftT <IN, OUT, M, A> (Func<PipeT<IN, OUT, M, A>> f) Source #

where M : Monad<M>

Create a lazy pipe

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> liftT <IN, OUT, M, A> (Func<ValueTask<PipeT<IN, OUT, M, A>>> f) Source #

where M : Monad<M>

Create an asynchronous lazy pipe

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> liftT <IN, OUT, M, A> (ValueTask<PipeT<IN, OUT, M, A>> task) Source #

where M : Monad<M>

Create an asynchronous pipe

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> liftM <IN, OUT, M, A> (K<M, A> ma) Source #

where M : Monad<M>

Create a pipe that simply returns the bound value of the lifted monad without yielding anything

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> liftM <IN, OUT, M, A> (ValueTask<K<M, A>> ma) Source #

where M : Monad<M>

Create a pipe that simply returns the bound value of the lifted monad without yielding anything

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> liftIO <IN, OUT, M, A> (IO<A> ma) Source #

where M : Monad<M>

Create a pipe that simply returns the bound value of the lifted monad without yielding anything

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> repeat <IN, OUT, M, A> (PipeT<IN, OUT, M, A> ma) Source #

where M : Monad<M>

Continually repeat the provided operation

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> repeat <IN, OUT, M, A> (Schedule schedule, PipeT<IN, OUT, M, A> ma) Source #

where M : Monad<M>

Repeat the provided operation based on the schedule provided

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> repeatM <IN, OUT, M, A> (K<M, A> ma) Source #

where M : Monad<M>

Continually lift & repeat the provided operation

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, A> repeatM <IN, OUT, M, A> (Schedule schedule, K<M, A> ma) Source #

where M : Monad<M>

Repeat the provided operation based on the schedule provided

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

returns

method PipeT<IN, OUT, M, Unit> fold <IN, OUT, M, A> ( Schedule Time, Func<OUT, A, OUT> Fold, OUT Init, PipeT<IN, OUT, M, A> Item) Source #

where M : Monad<M>

Fold the given pipe until the Schedule completes. Once complete, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Time

Schedule to run each item

param Fold

Fold function

param Init

Initial state

param Item

Pipe to fold

returns

method PipeT<IN, OUT, M, Unit> foldUntil <IN, OUT, M, A> ( Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init, PipeT<IN, OUT, M, A> Item) Source #

where M : Monad<M>

Fold the given pipe until the predicate is true. Once true the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

param Item

Pipe to fold

returns

method PipeT<IN, OUT, M, Unit> foldUntil <IN, OUT, M, A> ( Schedule Time, Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init, PipeT<IN, OUT, M, A> Item) Source #

where M : Monad<M>

Fold the given pipe until the predicate is true or the Schedule completes. Once true, or completed, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Time

Schedule to run each item

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

param Item

Pipe to fold

returns

method PipeT<IN, OUT, M, Unit> foldWhile <IN, OUT, M, A> ( Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init, PipeT<IN, OUT, M, A> Item) Source #

where M : Monad<M>

Fold the given pipe while the predicate is true. Once false the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

param Item

Pipe to fold

returns

method PipeT<IN, OUT, M, Unit> foldWhile <IN, OUT, M, A> ( Schedule Time, Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init, PipeT<IN, OUT, M, A> Item) Source #

where M : Monad<M>

Fold the given pipe while the predicate is true or the Schedule completes. Once false, or completed, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

type A

Bound value type

param Time

Schedule to run each item

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

param Item

Pipe to fold

returns

method PipeT<IN, OUT, M, Unit> fold <IN, OUT, M> ( Schedule Time, Func<OUT, IN, OUT> Fold, OUT Init) Source #

where M : Monad<M>

Fold the given pipe until the Schedule completes. Once complete, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

param Time

Schedule to run each item

param Fold

Fold function

param Init

Initial state

returns

method PipeT<IN, OUT, M, Unit> foldUntil <IN, OUT, M> ( Func<OUT, IN, OUT> Fold, Func<(OUT State, IN Value), bool> Pred, OUT Init) Source #

where M : Monad<M>

Fold the given pipe until the predicate is true. Once true the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method PipeT<IN, OUT, M, Unit> foldUntil <IN, OUT, M> ( Schedule Time, Func<OUT, IN, OUT> Fold, Func<(OUT State, IN Value), bool> Pred, OUT Init) Source #

where M : Monad<M>

Fold the given pipe until the predicate is true or the Schedule completes. Once true, or completed, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

param Time

Schedule to run each item

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method PipeT<IN, OUT, M, Unit> foldWhile <IN, OUT, M> ( Func<OUT, IN, OUT> Fold, Func<(OUT State, IN Value), bool> Pred, OUT Init) Source #

where M : Monad<M>

Fold the given pipe while the predicate is true. Once false the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method PipeT<IN, OUT, M, Unit> foldWhile <IN, OUT, M> ( Schedule Time, Func<OUT, IN, OUT> Fold, Func<(OUT State, IN Value), bool> Pred, OUT Init) Source #

where M : Monad<M>

Fold the given pipe while the predicate is true or the Schedule completes. Once false, or completed, the pipe yields the aggregated value downstream.

Parameters

type IN

Stream value to consume

type OUT

Stream value to produce

type M

Lifted monad type

param Time

Schedule to run each item

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

class PipeT <IN, OUT, M> Source #

where M : Monad<M>