| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Polysemy.Conc.Effect.Lock
Description
Lock effect, Internal
Documentation
data Lock :: Effect where Source #
An exclusive lock or mutex, protecting a region from concurrent access.
Constructors
| Lock :: m a -> Lock m a | Run an action if the lock is available, block otherwise. |
| LockOr :: m a -> m a -> Lock m a | Run the second action if the lock is available, or the first action otherwise. |
Instances
| type DefiningModule Lock Source # | |
Defined in Polysemy.Conc.Effect.Lock | |
lock :: forall r a. Member Lock r => Sem r a -> Sem r a Source #
Run an action if the lock is available, block otherwise.
lockOr :: forall r a. Member Lock r => Sem r a -> Sem r a -> Sem r a Source #
Run an action if the lock is available, block otherwise.