polysemy-1.5.0.0: Higher-order, low-boilerplate free monads.
Safe HaskellNone
LanguageHaskell2010

Polysemy.Internal.Forklift

Synopsis

Documentation

data Forklift r Source #

A promise for interpreting an effect of the union r in another thread.

Since: 0.5.0.0

Constructors

forall a. Forklift 

Fields

runViaForklift :: Member (Embed IO) r => InChan (Forklift r) -> Sem r a -> IO a Source #

A strategy for automatically interpreting an entire stack of effects by just shipping them off to some other interpretation context.

Since: 0.5.0.0

withLowerToIO Source #

Arguments

:: Member (Embed IO) r 
=> ((forall x. Sem r x -> IO x) -> IO () -> IO a)

A lambda that takes the lowering function, and a finalizing IO action to mark a the forked thread as being complete. The finalizing action need not be called.

-> Sem r a 

Run an effect stack all the way down to IO by running it in a new thread, and temporarily turning the current thread into an event poll.

This function creates a thread, and so should be compiled with -threaded.

Since: 0.5.0.0