{-# options_haddock prune #-}
module Polysemy.Conc.Effect.Events where
import Polysemy.Scoped (Scoped_, scoped_)
data Events (e :: Type) :: Effect where
Publish :: e -> Events e m ()
makeSem_ ''Events
publish ::
∀ e r .
Member (Events e) r =>
e ->
Sem r ()
data Consume (e :: Type) :: Effect where
Consume :: Consume e m e
makeSem_ ''Consume
consume ::
∀ e r .
Member (Consume e) r =>
Sem r e
subscribe ::
∀ e r .
Member (Scoped_ (Consume e)) r =>
InterpreterFor (Consume e) r
subscribe :: forall e (r :: EffectRow).
Member (Scoped_ (Consume e)) r =>
InterpreterFor (Consume e) r
subscribe =
Sem (Consume e : r) a -> Sem r a
forall (effect :: Effect) (r :: EffectRow).
Member (Scoped_ effect) r =>
InterpreterFor effect r
scoped_