LanguageExt.Pipes

LanguageExt.Pipes Concurrent Source

Contents

record Source <A> Source #

Properties

property Source<A> Empty Source #

An Source that never yields a value

Methods

method IO<A> Read () Source #

Read value from the Source

Raises a Errors.SourceChannelClosed if the channel is closed or empty

Parameters

returns

First available value from the channel

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

Functor map

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

Monad bind

method Source<B> ApplyBack <B> (Source<Func<A, B>> ff) Source #

Applicative apply

method Source<A> Combine (Source<A> rhs) Source #

Combine two Sourcees into a single Source. The value streams are both merged into a new stream. Values are yielded as they become available.

Parameters

param rhs

Right hand side

returns

Merged stream of values

method Source<A> Choose (Source<A> rhs) Source #

Choose a value from the first Source to successfully yield

Parameters

param rhs
returns

Value from this Source if there are any available, if not, from rhs. If rhs is also empty then Errors.SourceChannelClosed is raised

method Source<B> Bind <B> (Func<A, K<Source, B>> f) Source #

Monad bind

method ProducerT<A, M, Unit> ToProducerT <M> () Source #

where M : Monad<M>

Convert Source to a ProducerT pipe component

Parameters

type M

Monad to lift (must support IO)

returns

ProducerT

method Producer<RT, A, Unit> ToProducer <RT> () Source #

Convert Source to a Producer pipe component

Parameters

returns

Producer

Operators

operator + (Source<A> lhs, Source<A> rhs) Source #

Combine two Sourcees into a single Source. The value streams are both merged into a new stream. Values are yielded as they become available.

Parameters

param lhs

Left hand side

param rhs

Right hand side

returns

Merged stream of values

operator | (Source<A> lhs, Source<A> rhs) Source #

Choose a value from the first Source to successfully yield

Parameters

param lhs

Left hand side

param rhs

Right hand side

returns

Value from the lhs Source if there are any available, if not, from rhs. If rhs is also empty then Errors.SourceChannelClosed is raised

class SourceExtensions Source #

Methods

method Source<A> As <A> (this K<Source, A> ma) Source #

Downcast

class Source Source #