Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Sync d :: Effect where
- Block :: Sync d m d
- Wait :: TimeUnit u => u -> Sync d m (Maybe d)
- Try :: Sync d m (Maybe d)
- TakeBlock :: Sync d m d
- TakeWait :: TimeUnit u => u -> Sync d m (Maybe d)
- TakeTry :: Sync d m (Maybe d)
- ReadBlock :: Sync d m d
- ReadWait :: TimeUnit u => u -> Sync d m (Maybe d)
- ReadTry :: Sync d m (Maybe d)
- PutBlock :: d -> Sync d m ()
- PutWait :: TimeUnit u => u -> d -> Sync d m Bool
- PutTry :: d -> Sync d m Bool
- Empty :: Sync d m Bool
- type ScopedSync res a = Scoped (SyncResources res) (Sync a)
Documentation
data Sync d :: Effect where Source #
Abstracts an MVar
.
For documentation on the constructors, see the module Polysemy.Conc.Effect.Sync.
import Polysemy.Conc (Sync) import qualified Polysemy.Conc.Effect.Sync as Sync prog :: Member (Sync Int) r => Sem r Int prog = do Sync.putTry 5 Sync.takeBlock
Block :: Sync d m d | Read the variable, waiting until a value is available. |
Wait :: TimeUnit u => u -> Sync d m (Maybe d) | Read the variable, waiting until a value is available or the timeout has expired. |
Try :: Sync d m (Maybe d) | Read the variable, returning |
TakeBlock :: Sync d m d | Take the variable, waiting until a value is available. |
TakeWait :: TimeUnit u => u -> Sync d m (Maybe d) | Take the variable, waiting until a value is available or the timeout has expired. |
TakeTry :: Sync d m (Maybe d) | Take the variable, returning |
ReadBlock :: Sync d m d | Read the variable, waiting until a value is available. |
ReadWait :: TimeUnit u => u -> Sync d m (Maybe d) | Read the variable, waiting until a value is available or the timeout has expired. |
ReadTry :: Sync d m (Maybe d) | Read the variable, returning |
PutBlock :: d -> Sync d m () | Write the variable, waiting until it is writable. |
PutWait :: TimeUnit u => u -> d -> Sync d m Bool | Write the variable, waiting until it is writable or the timeout has expired. |
PutTry :: d -> Sync d m Bool | Write the variable, returning |
Empty :: Sync d m Bool | Indicate whether the variable is empty. |
Instances
type DefiningModule Sync Source # | |
Defined in Polysemy.Conc.Effect.Sync |
type ScopedSync res a = Scoped (SyncResources res) (Sync a) Source #
Convenience alias.