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. |
Sub modules
Eff |
IO |
Schedule |
Source |
StreamT |
method IO<Source<A>> Source <A> () Source #
Start a new source
returns | A source in an IO computation |
method StreamT<M, A> await <M, A> (Source<A> source) Source #
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.
type | M | Monad type lifted into the stream |
returns | StreamT monad transformer that will get the values coming downstream |