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)
- 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 a = Scoped_ (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 |
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. |
type ScopedSync a = Scoped_ (Sync a) Source #
Convenience alias.