LanguageExt.Core

LanguageExt.Core Effects

Effects are functorial, monadic, and applicative types that are designed to capture IO based side-effects.

Section Type Description
IO IO<A> Asynchronous and synchronous IO. Captures side-effects, manages resources, but throws exceptions. The IO monad is the base of all IO based operations and should be used in your monad-transformer stacks when you need IO.
Eff Eff<A> Asynchronous and synchronous IO. Captures side-effects, manages resources, handles exceptions elegantly.
Eff Eff<RT, A> Asynchronous and synchronous IO. Captures side-effects, manages resources, handles exceptions elegantly, and has an injectable runtime (RT) which can provide configuration and dependency-injection
StreamT StreamT<M, A> Lazy sequence monad transformer that can be used to stream effects synchronously or asynchronously. Most useful when pared with IO monads, but can be pared with any monad M, to create a stream of M effects.
Pipes Proxy<RT, UOut, UIn, DIn, DOut, A> Base of all Pipes types - single type that unifies unidirectional bidirectional streaming channels.

Contents

Sub modules

Eff
IO
Schedule
Source
StreamT

struct MinRT Source #

Minimal runtime for running the non-runtime based IO monads

class Prelude Source #

Methods

method IO<Source<A>> Source <A> () Source #

Start a new source

Parameters

returns

A source in an IO computation

method StreamT<M, A> await <M, A> (Source<A> source) Source #

where M : Monad<M>

Subscribe to the source and await the values

Each subscriber runs on the same thread as the event-distributor. So, if you have multiple subscribers they will be processed serially for each event. If you want the subscribers to run in parallel then you must lift the IO monad when calling Subscribe and forkIO the stream. This gives fine-grained control over when to run events in parallel.

Parameters

type M

Monad type lifted into the stream

returns

StreamT monad transformer that will get the values coming downstream

method IO<Unit> post <A> (Source<A> source, A value) Source #

Post a value to flow downstream

Parameters

param value

Value

returns

IO effect

method Func<A, IO<Unit>> post <A> (Source<A> source) Source #

Post a value to flow downstream (partially applied)

Parameters

param value

Value

returns

IO effect