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

Control.Effect.Fix

Synopsis

Effects

newtype Fix m a where Source #

An effect corresponding to the MonadFix type class.

Effly's MonadFix instance is based on this effect; by having access to Fix, you're able to use recursive do notation inside of effect handlers.

Fix is typically 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 Fix instance (if possible). threadFixViaClass can help you with that.

The following threading constraints accept Fix:

• ReaderThreads
• StateThreads
• StateLazyThreads
• ErrorThreads
• WriterThreads
• WriterLazyThreads

Constructors

 Fix :: (a -> m a) -> Fix m a

Instances

Instances details

Interpretations

fixToFinal :: (Carrier m, MonadFix m) => FixToFinalC m a -> m a Source #

Run a Fix effect if the final monad and all carriers transforming it are MonadFix.

Derivs (FixToFinalC m) = Fix ': Derivs m
Prims  (FixToFinalC m) = Fix ': Prims m

A valid definition of threadEff for a ThreadsEff t Fix instance, given that t lifts MonadFix.