polysemy-conc-0.7.0.0: Polysemy Effects for Concurrency
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Conc.Effect.Events

Description

 
Synopsis

Documentation

newtype EventResource resource Source #

Marker for the Scoped resource for Events.

Constructors

EventResource 

Fields

Instances

Instances details
Generic (EventResource resource) Source # 
Instance details

Defined in Polysemy.Conc.Effect.Events

Associated Types

type Rep (EventResource resource) :: Type -> Type #

Methods

from :: EventResource resource -> Rep (EventResource resource) x #

to :: Rep (EventResource resource) x -> EventResource resource #

Show resource => Show (EventResource resource) Source # 
Instance details

Defined in Polysemy.Conc.Effect.Events

Methods

showsPrec :: Int -> EventResource resource -> ShowS #

show :: EventResource resource -> String #

showList :: [EventResource resource] -> ShowS #

Eq resource => Eq (EventResource resource) Source # 
Instance details

Defined in Polysemy.Conc.Effect.Events

Methods

(==) :: EventResource resource -> EventResource resource -> Bool #

(/=) :: EventResource resource -> EventResource resource -> Bool #

type Rep (EventResource resource) Source # 
Instance details

Defined in Polysemy.Conc.Effect.Events

type Rep (EventResource resource) = D1 ('MetaData "EventResource" "Polysemy.Conc.Effect.Events" "polysemy-conc-0.7.0.0-D8Pxd1PIgSNH4F7k1kp4ui" 'True) (C1 ('MetaCons "EventResource" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEventToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 resource)))

data Events (resource :: Type) (e :: Type) :: Effect where Source #

An event publisher that can be consumed from multiple threads.

Constructors

Publish :: e -> Events resource e m () 

Instances

Instances details
type DefiningModule Events Source # 
Instance details

Defined in Polysemy.Conc.Effect.Events

type DefiningModule Events = "Polysemy.Conc.Effect.Events"

publish :: forall e resource r. Member (Events resource e) r => e -> Sem r () Source #

Publish one event.

data Consume (e :: Type) :: Effect where Source #

Consume events emitted by Events.

Constructors

Consume :: Consume e m e 

Instances

Instances details
type DefiningModule Consume Source # 
Instance details

Defined in Polysemy.Conc.Effect.Events

type DefiningModule Consume = "Polysemy.Conc.Effect.Events"

consume :: forall e r. Member (Consume e) r => Sem r e Source #

Consume one event emitted by Events.

subscribe :: forall e resource r. Member (Scoped (EventResource resource) (Consume e)) r => InterpreterFor (Consume e) r Source #

Create a new scope for Events, causing the nested program to get its own copy of the event stream. To be used with interpretEventsChan.