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

Contents

Synopsis

# Effects

data ReaderPrim i m a where Source #

A primitive effect that may be used for interpreters of connected Ask and Local effects.

This combines Ask and Local, which is relevant since certain monad transformers may only lift local if they also have access to ask.

ReaderPrim 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 ThreadsEff t (ReaderPrim i) instance (if possible). threadReaderPrimViaClass and threadReaderPrimViaRegional can help you with that.

The following threading constraints accept ReaderPrim:

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

Constructors

#### Instances

Instances details

threadReaderPrim :: forall i t m a. (MonadTrans t, Monad m) => ((forall x. ReaderPrim i m x -> m x) -> (i -> i) -> t m a -> t m a) -> (forall x. ReaderPrim i m x -> m x) -> ReaderPrim i (t m) a -> t m a Source #

Construct a valid definition of threadEff for a ThreadsEff t (ReaderPrim w) instance only by specifying how ReaderPrimLocal should be lifted.

This uses lift to lift ReaderPrimAsk.

A valid definition of threadEff for a ThreadsEff t (ReaderPrim i) instance, given that t lifts MonadReader i.
A valid definition of threadEff for a ThreadsEff t (ReaderPrim i) instance, given that t threads Regional s for any s.