in-other-words-0.1.0.0: A higher-order effect system where the sky's the limit

Control.Effect.Type.ListenPrim

Contents

Synopsis

# Effects

data ListenPrim w m a where Source #

A primitive effect that may be used for interpreters of connected Tell and Listen effects.

This combines Tell and Listen. This may be relevant if there are monad transformers that may only lift listen if they also have access to tell.

ListenPrim is only used as a primitive effect. If you define a Carrier that relies on a novel non-trivial monad transformer t, then you need to make a Monoid w => ThreadsEff t (ListenPrim w) instance (if possible). threadListenPrim and threadListenPrimViaClass can help you with that.

The following threading constraints accept ListenPrim:

• ReaderThreads
• StateThreads
• StateLazyThreads
• ErrorThreads
• WriterThreads
• WriterLazyThreads
• NonDetThreads
• SteppedThreads
• ContThreads

Constructors

 ListenPrimTell :: w -> ListenPrim w m () ListenPrimListen :: m a -> ListenPrim w m (w, a)

#### Instances

Instances details

Construct a valid definition of threadEff for a ThreadsEff t (ListenPrim w) instance only be specifying how ListenPrimListen should be lifted.
This uses lift to lift ListenPrimTell.
A valid definition of threadEff for a ThreadsEff t (ListenPrim w) instance, given that t lifts MonadWriter w.
BEWARE: threadListenPrimViaClass is only safe if the implementation of listen for t m only makes use of listen and tell for m, and not pass.