Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Consume (e :: Type) :: Effect where
- newtype EventToken token = EventToken {
- unEventToken :: token
- data Events (token :: Type) (e :: Type) :: Effect where
- subscribe :: forall e token r. Member (Scoped (EventToken token) (Consume e)) r => InterpreterFor (Consume e) r
Documentation
data Consume (e :: Type) :: Effect where Source #
Consume events emitted by Events
.
Instances
type DefiningModule Consume Source # | |
Defined in Polysemy.Conc.Effect.Events |
newtype EventToken token Source #
EventToken | |
|
Instances
Eq token => Eq (EventToken token) Source # | |
Defined in Polysemy.Conc.Effect.Events (==) :: EventToken token -> EventToken token -> Bool # (/=) :: EventToken token -> EventToken token -> Bool # | |
Show token => Show (EventToken token) Source # | |
Defined in Polysemy.Conc.Effect.Events showsPrec :: Int -> EventToken token -> ShowS # show :: EventToken token -> String # showList :: [EventToken token] -> ShowS # | |
Generic (EventToken token) Source # | |
Defined in Polysemy.Conc.Effect.Events type Rep (EventToken token) :: Type -> Type # from :: EventToken token -> Rep (EventToken token) x # to :: Rep (EventToken token) x -> EventToken token # | |
type Rep (EventToken token) Source # | |
Defined in Polysemy.Conc.Effect.Events type Rep (EventToken token) = D1 ('MetaData "EventToken" "Polysemy.Conc.Effect.Events" "polysemy-conc-0.3.0.0-inplace" 'True) (C1 ('MetaCons "EventToken" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEventToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 token))) |
data Events (token :: Type) (e :: Type) :: Effect where Source #
An event publisher that can be consumed from multiple threads.
Instances
type DefiningModule Events Source # | |
Defined in Polysemy.Conc.Effect.Events |
subscribe :: forall e token r. Member (Scoped (EventToken token) (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
.