| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Polysemy.Async
Contents
Synopsis
- data Async m a where
- async :: forall r a. MemberWithError Async r => Sem r a -> Sem r (Async (Maybe a))
- await :: forall r a. MemberWithError Async r => Async a -> Sem r a
- asyncToIO :: LastMember (Embed IO) r => Sem (Async ': r) a -> Sem r a
- lowerAsync :: Member (Embed IO) r => (forall x. Sem r x -> IO x) -> Sem (Async ': r) a -> Sem r a
Effect
An effect for spawning asynchronous computations.
The Maybe returned by async is due to the fact that we can't be sure an
 Error effect didn't fail locally.
Since: 0.5.0.0
Instances
| type DefiningModule Async Source # | |
| Defined in Polysemy.Async | |
Actions
Interpretations
asyncToIO :: LastMember (Embed IO) r => Sem (Async ': r) a -> Sem r a Source #
A more flexible --- though less performant ---  version of lowerAsync.
This function is capable of running Async effects anywhere within an
 effect stack, without relying on an explicit function to lower it into IO.
 Notably, this means that State effects will be consistent
 in the presence of Async.
Since: 1.0.0.0