polysemy-conc-0.14.1.1: Polysemy effects for concurrency
Safe HaskellNone
LanguageGHC2021

Polysemy.Conc.Effect.Gate

Description

 
Synopsis

Documentation

data Gate (a :: Type -> Type) b where Source #

A single-use synchronization point that blocks all consumers who called gate until signal is called.

The constructors are exported from Polysemy.Conc.Gate.

Constructors

Signal :: forall (a :: Type -> Type). Gate a () 
Gate :: forall (a :: Type -> Type). Gate a () 

type Gates = Scoped_ Gate Source #

Convenience alias for scoped Gate.

withGate :: forall (r :: EffectRow). Member (Scoped_ Gate) r => InterpreterFor Gate r Source #

Run an action with a locally scoped Gate effect.

This avoids a dependency on Embed IO in application logic while still allowing the effect to be scoped.