LanguageExt.Pipes

LanguageExt.Pipes Pipe

Contents

record Pipe <RT, IN, OUT, A> (PipeT<IN, OUT, Eff<RT>, A> Proxy) Source #

Pipe monad-transformer base-type for Eff-based streaming components:

  • Producer is a Pipe with the IN 'closed off' with Unit
  • Consumer is a Pipe with the OUT 'closed off' with Void
  • Effect is a Pipe with the IN and OUT 'closed off' with Unit upstream and Void downstream

Unlike the general purpose PipeT, which will lift any monad, this type only lifts the Eff monad.

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 Pipe<RT, IN, OUT1, A> Compose <OUT1> (Pipe<RT, OUT, OUT1, A> rhs) Source #

method Pipe<RT, IN, OUT1, A> Compose <OUT1> (PipeT<OUT, OUT1, Eff<RT>, A> rhs) Source #

method Consumer<RT, IN, A> Compose (Consumer<RT, OUT, A> rhs) Source #

method Consumer<RT, IN, A> Compose (ConsumerT<OUT, Eff<RT>, A> rhs) Source #

method Pipe<RT, IN, OUT, B> Map <B> (Func<A, B> f) Source #

method Pipe<RT, IN, OUT, B> MapM <B> (Func<Eff<RT, A>, Eff<RT, B>> f) Source #

method Pipe<RT, IN, OUT, B> ApplyBack <B> (Pipe<RT, IN, OUT, Func<A, B>> ff) Source #

method Pipe<RT, IN, OUT, B> Action <B> (Pipe<RT, IN, OUT, B> fb) Source #

method Pipe<RT, IN, OUT, B> Bind <B> (Func<A, Pipe<RT, IN, OUT, B>> f) Source #

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

method Pipe<RT, IN, OUT, B> Bind <B> (Func<A, K<Eff<RT>, B>> f) Source #

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

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

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

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

method Pipe<RT, IN, OUT, B> Select <B> (Func<A, B> f) Source #

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

method Pipe<RT, IN, OUT, C> SelectMany <B, C> (Func<A, K<Eff<RT>, B>> f, Func<A, B, C> g) Source #

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

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

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

method Pipe<RT, IN, OUT, 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 Pipe<RT, IN, OUT, 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 Pipe<RT, IN, OUT, 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 Pipe<RT, IN, OUT, 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 Pipe<RT, IN, OUT, 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 | (Pipe<RT, IN, OUT, A> lhs, Pipe<RT, OUT, OUT, A> rhs) Source #

operator | (Pipe<RT, IN, OUT, A> lhs, PipeT<OUT, OUT, Eff<RT>, A> rhs) Source #

operator | (Producer<RT, IN, A> lhs, Pipe<RT, IN, OUT, A> rhs) Source #

operator | (ProducerT<IN, Eff<RT>, A> lhs, Pipe<RT, IN, OUT, A> rhs) Source #

operator | (Pipe<RT, IN, OUT, A> lhs, Consumer<RT, OUT, A> rhs) Source #

operator | (Pipe<RT, IN, OUT, A> lhs, ConsumerT<OUT, Eff<RT>, A> rhs) Source #

class PipeExtensions Source #

Methods

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

Downcast

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

Monad bind

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

Monad bind

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

Monad bind

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

Monad bind

method Pipe<RT, IN, OUT, B> Bind <RT, IN, OUT, A, B> ( this K<Eff<RT>, A> ma, Func<A, Pipe<RT, IN, OUT, B>> f) Source #

Monad bind

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

Monad bind

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

Monad bind

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

Monad bind

method Pipe<RT, IN, OUT, C> SelectMany <RT, IN, OUT, A, C> ( this K<Pipe<RT, IN, OUT>, A> ma, Func<A, Guard<Error, Unit>> bind, Func<A, Unit, C> project) Source #

Monad bind operation

method Pipe<RT, IN, OUT, C> SelectMany <RT, IN, OUT, B, C> ( this Guard<Error, Unit> ma, Func<Unit, K<Pipe<RT, IN, OUT>, B>> bind, Func<Unit, B, C> project) Source #

Monad bind operation

class Pipe Source #

Pipe streaming producer monad-transformer

Methods

method Pipe<RT, IN, OUT, Unit> yield <RT, IN, OUT> (OUT value) Source #

Yield a value downstream

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

returns

method Pipe<RT, IN, OUT, Unit> yieldAll <RT, IN, OUT> (IEnumerable<OUT> values) Source #

Yield all values downstream

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

returns

method Pipe<RT, IN, OUT, Unit> yieldAll <RT, IN, OUT> (IAsyncEnumerable<OUT> values) Source #

Yield all values downstream

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

returns

method Pipe<RT, IN, OUT, Unit> yieldRepeat <RT, IN, OUT> (K<Eff<RT>, OUT> ma) Source #

Evaluate the M monad repeatedly, yielding its bound values downstream

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

returns

method Pipe<RT, IN, OUT, Unit> yieldRepeatIO <RT, IN, OUT> (IO<OUT> ma) Source #

Evaluate the IO monad repeatedly, yielding its bound values downstream

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

returns

method Pipe<RT, IN, OUT, IN> awaiting <RT, IN, OUT> () Source #

Await a value from upstream

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

returns

Pipe

method Pipe<RT, A, A, Unit> filter <RT, A> (Func<A, bool> f) Source #

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

Parameters

type RT

Effect runtime type

type A

Stream value to consume and produce

param f

Predicate function

returns

Pipe

method Pipe<RT, IN, OUT, Unit> map <RT, IN, OUT> (Func<IN, OUT> f) Source #

Create a pipe from a mapping function

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

param f

Mapping function

returns

Pipe

method Pipe<RT, IN, OUT, Unit> mapM <RT, IN, OUT> (Func<IN, K<Eff<RT>, OUT>> f) Source #

Create a pipe from a mapping function

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

param f

Mapping function

returns

Pipe

method Pipe<RT, IN, OUT, A> pure <RT, IN, OUT, A> (A value) Source #

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> error <RT, IN, OUT, A> (Error value) Source #

Create a pipe that always fails

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> empty <RT, IN, OUT, A> () Source #

Create a pipe that yields nothing at all

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> lift <RT, IN, OUT, A> (Func<A> f) Source #

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> liftT <RT, IN, OUT, A> (Func<Pipe<RT, IN, OUT, A>> f) Source #

Create a lazy pipe

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> liftT <RT, IN, OUT, A> (Func<ValueTask<Pipe<RT, IN, OUT, A>>> f) Source #

Create an asynchronous lazy pipe

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> liftT <RT, IN, OUT, A> (ValueTask<Pipe<RT, IN, OUT, A>> task) Source #

Create an asynchronous pipe

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

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

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> liftM <RT, IN, OUT, A> (ValueTask<K<Eff<RT>, A>> ma) Source #

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> liftIO <RT, IN, OUT, A> (IO<A> ma) Source #

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> repeat <RT, IN, OUT, A> (Pipe<RT, IN, OUT, A> ma) Source #

Continually repeat the provided operation

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> repeat <RT, IN, OUT, A> (Schedule schedule, Pipe<RT, IN, OUT, A> ma) Source #

Repeat the provided operation based on the schedule provided

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

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

Continually lift & repeat the provided operation

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

method Pipe<RT, IN, OUT, A> repeatM <RT, IN, OUT, A> (Schedule schedule, K<Eff<RT>, A> ma) Source #

Repeat the provided operation based on the schedule provided

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

returns

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

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

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 Pipe<RT, IN, OUT, Unit> foldUntil <RT, IN, OUT, A> ( Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init, Pipe<RT, IN, OUT, A> Item) Source #

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

param Item

Pipe to fold

returns

method Pipe<RT, IN, OUT, Unit> foldUntil <RT, IN, OUT, A> ( Schedule Time, Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init, Pipe<RT, IN, OUT, A> Item) 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 RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

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 Pipe<RT, IN, OUT, Unit> foldWhile <RT, IN, OUT, A> ( Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init, Pipe<RT, IN, OUT, A> Item) Source #

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

type A

Bound value type

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

param Item

Pipe to fold

returns

method Pipe<RT, IN, OUT, Unit> foldWhile <RT, IN, OUT, A> ( Schedule Time, Func<OUT, A, OUT> Fold, Func<(OUT State, A Value), bool> Pred, OUT Init, Pipe<RT, IN, OUT, A> Item) 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 RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

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 Pipe<RT, IN, OUT, Unit> fold <RT, IN, OUT> ( Schedule Time, Func<OUT, IN, OUT> Fold, OUT Init) Source #

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

Parameters

type RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

param Time

Schedule to run each item

param Fold

Fold function

param Init

Initial state

returns

method Pipe<RT, IN, OUT, Unit> foldUntil <RT, IN, OUT> ( Func<OUT, IN, OUT> Fold, Func<(OUT State, IN 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 RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method Pipe<RT, IN, OUT, Unit> foldUntil <RT, IN, OUT> ( Schedule Time, Func<OUT, IN, OUT> Fold, Func<(OUT State, IN 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 RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

param Time

Schedule to run each item

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method Pipe<RT, IN, OUT, Unit> foldWhile <RT, IN, OUT> ( Func<OUT, IN, OUT> Fold, Func<(OUT State, IN 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 RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

method Pipe<RT, IN, OUT, Unit> foldWhile <RT, IN, OUT> ( Schedule Time, Func<OUT, IN, OUT> Fold, Func<(OUT State, IN 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 RT

Effect runtime type

type IN

Stream value to consume

type OUT

Stream value to produce

param Time

Schedule to run each item

param Fold

Fold function

param Pred

Until predicate

param Init

Initial state

returns

class Pipe <RT, IN, OUT> Source #