in-other-words 0.1.0.0 → 0.1.1.0
raw patch · 49 files changed
+774/−555 lines, 49 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Control.Effect.Internal.Cont: instance (Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Free.Church.Alternate.FreeT (Control.Effect.Internal.Cont.ContBase (m r))) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Cont.ContC r m)
- Control.Effect.Internal.Cont: instance (Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Free.Church.Alternate.FreeT (Control.Effect.Internal.Cont.ContBase (m r))) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Cont.ShiftC r m)
- Control.Effect.Internal.Writer: data Pass s m a
- Control.Effect.Internal.Writer: instance (Control.Effect.Internal.Carrier m, GHC.Base.Monoid s, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.CPS.WriterT s) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance (Control.Effect.Internal.Carrier m, GHC.Base.Monoid s, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.CPS.WriterT s) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance (Control.Effect.Internal.Carrier m, GHC.Base.Monoid s, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.CPS.WriterT s) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance (Control.Monad.Trans.Control.MonadBaseControl b m, GHC.Base.Monoid s) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance (Control.Monad.Trans.Control.MonadBaseControl b m, GHC.Base.Monoid s) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance (Control.Monad.Trans.Control.MonadBaseControl b m, GHC.Base.Monoid s) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.Lazy.WriterT s) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.Lazy.WriterT s) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.Lazy.WriterT s) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Base.MonadBase b m) => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Base.MonadBase b m) => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Base.MonadBase b m) => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadThrow m) => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadThrow m) => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Catch.MonadThrow m) => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Fail.MonadFail m) => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Fail.MonadFail m) => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Fail.MonadFail m) => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Fix.MonadFix m) => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Fix.MonadFix m) => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Fix.MonadFix m) => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.IO.Class.MonadIO m) => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.IO.Class.MonadIO m) => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.IO.Class.MonadIO m) => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Trans.Control.MonadBaseControl b m) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Trans.Control.MonadBaseControl b m) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, Control.Monad.Trans.Control.MonadBaseControl b m) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Alternative m) => GHC.Base.Alternative (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Alternative m) => GHC.Base.Alternative (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Alternative m) => GHC.Base.Alternative (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Applicative m) => GHC.Base.Applicative (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Applicative m) => GHC.Base.Applicative (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Applicative m) => GHC.Base.Applicative (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Monad m) => GHC.Base.Monad (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Monad m) => GHC.Base.Monad (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.Monad m) => GHC.Base.Monad (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.MonadPlus m) => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.MonadPlus m) => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance (GHC.Base.Monoid s, GHC.Base.MonadPlus m) => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance (forall s. GHC.Base.Monoid s => Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.CPS.WriterT s) p) => Control.Effect.Internal.Writer.WriterThreads p
- Control.Effect.Internal.Writer: instance (forall s. GHC.Base.Monoid s => Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.Lazy.WriterT s) p) => Control.Effect.Internal.Writer.WriterLazyThreads p
- Control.Effect.Internal.Writer: instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.ListenC s)
- Control.Effect.Internal.Writer: instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.TellC s)
- Control.Effect.Internal.Writer: instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.WriterC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.ListenLazyC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.TellLazyC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.WriterLazyC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.Alternative (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.Alternative (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.Alternative (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.ListenC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.TellC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.WriterC s m)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.ListenLazyC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.TellLazyC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.WriterLazyC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.ListenC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.ListenLazyC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.TellC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.TellLazyC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.WriterC s)
- Control.Effect.Internal.Writer: instance GHC.Base.Monoid s => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.WriterLazyC s)
- Control.Effect.Type.ListenPrim: instance (Control.Effect.Internal.Reflection.Reifies s (Control.Effect.Internal.ViaAlg.ReifiedEffAlgebra (Control.Effect.Type.ListenPrim.ListenPrim w) m), GHC.Base.Monoid w, GHC.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter w (Control.Effect.Internal.ViaAlg.ViaAlg s (Control.Effect.Type.ListenPrim.ListenPrim w) m)
- Control.Effect.Type.ListenPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.CPS.WriterT s) (Control.Effect.Type.ListenPrim.ListenPrim w)
- Control.Effect.Type.ListenPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.Lazy.WriterT s) (Control.Effect.Type.ListenPrim.ListenPrim w)
- Control.Effect.Type.ListenPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.Strict.WriterT s) (Control.Effect.Type.ListenPrim.ListenPrim w)
- Control.Effect.Type.Unlift: data Unlift b m a
- Control.Effect.Type.WriterPrim: instance (Control.Effect.Internal.Reflection.Reifies s (Control.Effect.Internal.ViaAlg.ReifiedEffAlgebra (Control.Effect.Type.WriterPrim.WriterPrim w) m), GHC.Base.Monoid w, GHC.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter w (Control.Effect.Internal.ViaAlg.ViaAlg s (Control.Effect.Type.WriterPrim.WriterPrim w) m)
- Control.Effect.Type.WriterPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.CPS.WriterT s) (Control.Effect.Type.WriterPrim.WriterPrim w)
- Control.Effect.Type.WriterPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.Lazy.WriterT s) (Control.Effect.Type.WriterPrim.WriterPrim w)
- Control.Effect.Type.WriterPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.Strict.WriterT s) (Control.Effect.Type.WriterPrim.WriterPrim w)
- Control.Effect.Unlift: data Unlift b m a
- Control.Effect.Writer: data Pass s m a
- Control.Effect.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Listen (Data.Semigroup.Internal.Endo s)) m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToEndoWriterH (Control.Effect.Internal.Writer.Listen s) m
- Control.Effect.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Pass (Data.Semigroup.Internal.Endo s)) m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToEndoWriterH (Control.Effect.Internal.Writer.Pass s) m
- Control.Effect.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Tell (Data.Semigroup.Internal.Endo s)) m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToEndoWriterH (Control.Effect.Internal.Writer.Tell s) m
- Control.Effect.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (s -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO, Control.Effect.Type.Bracket.Bracket] m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToBracketH (Control.Effect.Internal.Writer.Listen s) m
- Control.Effect.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (s -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO, Control.Effect.Type.Bracket.Bracket] m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToBracketH (Control.Effect.Internal.Writer.Pass s) m
- Control.Effect.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (s -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO] m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterTVarH (Control.Effect.Internal.Writer.Tell s) m
- Control.Effect.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (s -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO] m, Control.Monad.Catch.MonadMask m) => Control.Effect.Carrier.Internal.Interpret.PrimHandler Control.Effect.Writer.WriterTVarH (Control.Effect.Type.ListenPrim.ListenPrim s) m
- Control.Effect.Writer: instance (GHC.Base.Monoid s, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (s -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO] m, Control.Monad.Catch.MonadMask m) => Control.Effect.Carrier.Internal.Interpret.PrimHandler Control.Effect.Writer.WriterTVarH (Control.Effect.Type.WriterPrim.WriterPrim s) m
- Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Tell (Data.Semigroup.Internal.Dual [s])) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.TellListH (Control.Effect.Internal.Writer.Tell s) m
- Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Tell (Data.Semigroup.Internal.Endo [s])) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.TellListLazyH (Control.Effect.Internal.Writer.Tell s) m
- Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Type.ListenPrim.ListenPrim s) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterTVarH (Control.Effect.Internal.Writer.Listen s) m
- Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Type.WriterPrim.WriterPrim s) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterTVarH (Control.Effect.Internal.Writer.Pass s) m
- Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Type.WriterPrim.WriterPrim s) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterTVarH (Control.Effect.Type.ListenPrim.ListenPrim s) m
+ Control.Effect.Embed: EmbedC :: m a -> EmbedC m a
+ Control.Effect.Embed: instance Control.Effect.Internal.Carrier m => Control.Effect.Internal.Carrier (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.Trans.Class.MonadTrans Control.Effect.Embed.EmbedC
+ Control.Effect.Embed: instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance Control.Monad.Trans.Control.MonadTransControl Control.Effect.Embed.EmbedC
+ Control.Effect.Embed: instance GHC.Base.Alternative m => GHC.Base.Alternative (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance GHC.Base.Applicative m => GHC.Base.Applicative (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Effect.Embed.EmbedC m)
+ Control.Effect.Embed: newtype EmbedC m a
+ Control.Effect.Embed: runEmbed :: Carrier m => EmbedC m a -> m a
+ Control.Effect.Internal.Cont: [Attempt] :: mr -> ContBase mr r r
+ Control.Effect.Internal.Cont: instance (Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Free.Church.Alternate.FreeT (Control.Effect.Internal.Cont.ContBase (m r) r)) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Cont.ContC r m)
+ Control.Effect.Internal.Cont: instance (Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Free.Church.Alternate.FreeT (Control.Effect.Internal.Cont.ContBase (m r) r)) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Cont.ShiftC r m)
+ Control.Effect.Internal.Writer: instance (Control.Effect.Internal.Carrier m, GHC.Base.Monoid o, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.CPS.WriterT o) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance (Control.Effect.Internal.Carrier m, GHC.Base.Monoid o, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.CPS.WriterT o) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance (Control.Effect.Internal.Carrier m, GHC.Base.Monoid o, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.CPS.WriterT o) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance (Control.Monad.Trans.Control.MonadBaseControl b m, GHC.Base.Monoid o) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance (Control.Monad.Trans.Control.MonadBaseControl b m, GHC.Base.Monoid o) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance (Control.Monad.Trans.Control.MonadBaseControl b m, GHC.Base.Monoid o) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.Lazy.WriterT o) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.Lazy.WriterT o) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Carrier m, Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.Lazy.WriterT o) (Control.Effect.Internal.Prims m)) => Control.Effect.Internal.Carrier (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Base.MonadBase b m) => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Base.MonadBase b m) => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Base.MonadBase b m) => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadCatch m) => Control.Monad.Catch.MonadCatch (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadMask m) => Control.Monad.Catch.MonadMask (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadThrow m) => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadThrow m) => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Catch.MonadThrow m) => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Fail.MonadFail m) => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Fail.MonadFail m) => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Fail.MonadFail m) => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Fix.MonadFix m) => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Fix.MonadFix m) => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Fix.MonadFix m) => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.IO.Class.MonadIO m) => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.IO.Class.MonadIO m) => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.IO.Class.MonadIO m) => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Trans.Control.MonadBaseControl b m) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Trans.Control.MonadBaseControl b m) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, Control.Monad.Trans.Control.MonadBaseControl b m) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Alternative m) => GHC.Base.Alternative (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Alternative m) => GHC.Base.Alternative (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Alternative m) => GHC.Base.Alternative (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Applicative m) => GHC.Base.Applicative (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Applicative m) => GHC.Base.Applicative (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Applicative m) => GHC.Base.Applicative (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Monad m) => GHC.Base.Monad (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Monad m) => GHC.Base.Monad (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.Monad m) => GHC.Base.Monad (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.MonadPlus m) => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.MonadPlus m) => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance (GHC.Base.Monoid o, GHC.Base.MonadPlus m) => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance (forall o. GHC.Base.Monoid o => Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.CPS.WriterT o) p) => Control.Effect.Internal.Writer.WriterThreads p
+ Control.Effect.Internal.Writer: instance (forall o. GHC.Base.Monoid o => Control.Effect.Internal.Union.Threads (Control.Monad.Trans.Writer.Lazy.WriterT o) p) => Control.Effect.Internal.Writer.WriterLazyThreads p
+ Control.Effect.Internal.Writer: instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.ListenC o)
+ Control.Effect.Internal.Writer: instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.TellC o)
+ Control.Effect.Internal.Writer: instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.WriterC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.ListenLazyC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.TellLazyC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Internal.Writer.WriterLazyC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.Alternative (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.Alternative (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.Alternative (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.ListenC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.TellC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Effect.Internal.Writer.WriterC o m)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.ListenLazyC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.TellLazyC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Class.MonadTrans (Control.Effect.Internal.Writer.WriterLazyC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.ListenC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.ListenLazyC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.TellC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.TellLazyC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.WriterC o)
+ Control.Effect.Internal.Writer: instance GHC.Base.Monoid o => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Internal.Writer.WriterLazyC o)
+ Control.Effect.Internal.Writer: newtype Pass o :: Effect
+ Control.Effect.Type.ListenPrim: instance (Control.Effect.Internal.Reflection.Reifies s (Control.Effect.Internal.ViaAlg.ReifiedEffAlgebra (Control.Effect.Type.ListenPrim.ListenPrim o) m), GHC.Base.Monoid o, GHC.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter o (Control.Effect.Internal.ViaAlg.ViaAlg s (Control.Effect.Type.ListenPrim.ListenPrim o) m)
+ Control.Effect.Type.ListenPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.CPS.WriterT s) (Control.Effect.Type.ListenPrim.ListenPrim o)
+ Control.Effect.Type.ListenPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.Lazy.WriterT s) (Control.Effect.Type.ListenPrim.ListenPrim o)
+ Control.Effect.Type.ListenPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.Strict.WriterT s) (Control.Effect.Type.ListenPrim.ListenPrim o)
+ Control.Effect.Type.Unlift: newtype Unlift b :: Effect
+ Control.Effect.Type.WriterPrim: instance (Control.Effect.Internal.Reflection.Reifies s (Control.Effect.Internal.ViaAlg.ReifiedEffAlgebra (Control.Effect.Type.WriterPrim.WriterPrim o) m), GHC.Base.Monoid o, GHC.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter o (Control.Effect.Internal.ViaAlg.ViaAlg s (Control.Effect.Type.WriterPrim.WriterPrim o) m)
+ Control.Effect.Type.WriterPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.CPS.WriterT s) (Control.Effect.Type.WriterPrim.WriterPrim o)
+ Control.Effect.Type.WriterPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.Lazy.WriterT s) (Control.Effect.Type.WriterPrim.WriterPrim o)
+ Control.Effect.Type.WriterPrim: instance GHC.Base.Monoid s => Control.Effect.Internal.Union.ThreadsEff (Control.Monad.Trans.Writer.Strict.WriterT s) (Control.Effect.Type.WriterPrim.WriterPrim o)
+ Control.Effect.Unlift: newtype Unlift b :: Effect
+ Control.Effect.Writer: ignoreTell :: forall o m a. Carrier m => IgnoreTellC o m a -> m a
+ Control.Effect.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Listen (Data.Semigroup.Internal.Endo o)) m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToEndoWriterH (Control.Effect.Internal.Writer.Listen o) m
+ Control.Effect.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Pass (Data.Semigroup.Internal.Endo o)) m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToEndoWriterH (Control.Effect.Internal.Writer.Pass o) m
+ Control.Effect.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Tell (Data.Semigroup.Internal.Endo o)) m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToEndoWriterH (Control.Effect.Internal.Writer.Tell o) m
+ Control.Effect.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (o -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO, Control.Effect.Type.Bracket.Bracket] m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToBracketH (Control.Effect.Internal.Writer.Listen o) m
+ Control.Effect.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (o -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO, Control.Effect.Type.Bracket.Bracket] m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterToBracketH (Control.Effect.Internal.Writer.Pass o) m
+ Control.Effect.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (o -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO] m) => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterTVarH (Control.Effect.Internal.Writer.Tell o) m
+ Control.Effect.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (o -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO] m, Control.Monad.Catch.MonadMask m) => Control.Effect.Carrier.Internal.Interpret.PrimHandler Control.Effect.Writer.WriterTVarH (Control.Effect.Type.ListenPrim.ListenPrim o) m
+ Control.Effect.Writer: instance (GHC.Base.Monoid o, Control.Effect.Internal.Effs '[Control.Effect.Internal.Reader.Reader (o -> GHC.Conc.Sync.STM ()), Control.Effect.Type.Embed.Embed GHC.Types.IO] m, Control.Monad.Catch.MonadMask m) => Control.Effect.Carrier.Internal.Interpret.PrimHandler Control.Effect.Writer.WriterTVarH (Control.Effect.Type.WriterPrim.WriterPrim o) m
+ Control.Effect.Writer: instance Control.Effect.Internal.Carrier m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.IgnoreTellH (Control.Effect.Internal.Writer.Tell o) m
+ Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Tell (Data.Semigroup.Internal.Dual [o])) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.TellListH (Control.Effect.Internal.Writer.Tell o) m
+ Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Internal.Writer.Tell (Data.Semigroup.Internal.Endo [o])) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.TellListLazyH (Control.Effect.Internal.Writer.Tell o) m
+ Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Type.ListenPrim.ListenPrim o) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterTVarH (Control.Effect.Internal.Writer.Listen o) m
+ Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Type.WriterPrim.WriterPrim o) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterTVarH (Control.Effect.Internal.Writer.Pass o) m
+ Control.Effect.Writer: instance Control.Effect.Internal.Eff (Control.Effect.Type.WriterPrim.WriterPrim o) m => Control.Effect.Carrier.Internal.Interpret.Handler Control.Effect.Writer.WriterTVarH (Control.Effect.Type.ListenPrim.ListenPrim o) m
+ Control.Effect.Writer: newtype Pass o :: Effect
+ Control.Effect.Writer: runTellAction :: forall o m a. Carrier m => (o -> m ()) -> InterpretReifiedC (Tell o) m a -> m a
+ Control.Effect.Writer: runTellActionSimple :: forall o m a p. (Carrier m, Threaders '[ReaderThreads] m p) => (o -> m ()) -> InterpretSimpleC (Tell o) m a -> m a
+ Control.Effect.Writer: type IgnoreTellC o = InterpretC IgnoreTellH (Tell o)
- Control.Effect: newtype Embed b m a
+ Control.Effect: newtype Embed b (m :: * -> *) a
- Control.Effect.Alt: data Alt m a
+ Control.Effect.Alt: data Alt (m :: * -> *) a
- Control.Effect.AtomicState: data AtomicState s m a
+ Control.Effect.AtomicState: data AtomicState s :: Effect
- Control.Effect.Bracket: data Bracket m a
+ Control.Effect.Bracket: data Bracket :: Effect
- Control.Effect.Embed: newtype Embed b m a
+ Control.Effect.Embed: newtype Embed b (m :: * -> *) a
- Control.Effect.Error: data Catch e m a
+ Control.Effect.Error: data Catch e :: Effect
- Control.Effect.Error: newtype Throw e m a
+ Control.Effect.Error: newtype Throw e (m :: * -> *) (a :: *)
- Control.Effect.ErrorIO: data ErrorIO m a
+ Control.Effect.ErrorIO: data ErrorIO (m :: * -> *) a
- Control.Effect.Fail: newtype Fail m a
+ Control.Effect.Fail: newtype Fail (m :: * -> *) (a :: *)
- Control.Effect.Fix: newtype Fix m a
+ Control.Effect.Fix: newtype Fix :: Effect
- Control.Effect.Fresh: data Fresh uniq m a
+ Control.Effect.Fresh: data Fresh uniq :: Effect
- Control.Effect.Internal.Cont: ContC :: FreeT (ContBase (m r)) m a -> ContC r m a
+ Control.Effect.Internal.Cont: ContC :: FreeT (ContBase (m r) r) m a -> ContC r m a
- Control.Effect.Internal.Cont: ShiftC :: FreeT (ContBase (m r)) m a -> ShiftC r m a
+ Control.Effect.Internal.Cont: ShiftC :: FreeT (ContBase (m r) r) m a -> ShiftC r m a
- Control.Effect.Internal.Cont: [Exit] :: r -> ContBase r a
+ Control.Effect.Internal.Cont: [Exit] :: r -> ContBase mr r a
- Control.Effect.Internal.Cont: [GetCont] :: ContBase r (Either (a -> r) a)
+ Control.Effect.Internal.Cont: [GetCont] :: ContBase mr r (Either (a -> mr) a)
- Control.Effect.Internal.Cont: [unContC] :: ContC r m a -> FreeT (ContBase (m r)) m a
+ Control.Effect.Internal.Cont: [unContC] :: ContC r m a -> FreeT (ContBase (m r) r) m a
- Control.Effect.Internal.Cont: [unShiftC] :: ShiftC r m a -> FreeT (ContBase (m r)) m a
+ Control.Effect.Internal.Cont: [unShiftC] :: ShiftC r m a -> FreeT (ContBase (m r) r) m a
- Control.Effect.Internal.Cont: data ContBase r a
+ Control.Effect.Internal.Cont: data ContBase mr r a
- Control.Effect.Internal.NonDet: data Cut m a
+ Control.Effect.Internal.NonDet: data Cut :: Effect
- Control.Effect.Internal.NonDet: newtype Cull m a
+ Control.Effect.Internal.NonDet: newtype Cull :: Effect
- Control.Effect.Internal.NonDet: newtype NonDet m a
+ Control.Effect.Internal.NonDet: newtype NonDet :: Effect
- Control.Effect.Internal.Reader: data Ask i m a
+ Control.Effect.Internal.Reader: data Ask i :: Effect
- Control.Effect.Internal.Reader: data Local i m a
+ Control.Effect.Internal.Reader: data Local i :: Effect
- Control.Effect.Internal.State: data State s m a
+ Control.Effect.Internal.State: data State s :: Effect
- Control.Effect.Internal.Writer: ListenC :: WriterT s m a -> ListenC s m a
+ Control.Effect.Internal.Writer: ListenC :: WriterT o m a -> ListenC o m a
- Control.Effect.Internal.Writer: ListenLazyC :: WriterT s m a -> ListenLazyC s m a
+ Control.Effect.Internal.Writer: ListenLazyC :: WriterT o m a -> ListenLazyC o m a
- Control.Effect.Internal.Writer: TellC :: WriterT s m a -> TellC s m a
+ Control.Effect.Internal.Writer: TellC :: WriterT o m a -> TellC o m a
- Control.Effect.Internal.Writer: TellLazyC :: WriterT s m a -> TellLazyC s m a
+ Control.Effect.Internal.Writer: TellLazyC :: WriterT o m a -> TellLazyC o m a
- Control.Effect.Internal.Writer: WriterC :: WriterT s m a -> WriterC s m a
+ Control.Effect.Internal.Writer: WriterC :: WriterT o m a -> WriterC o m a
- Control.Effect.Internal.Writer: WriterLazyC :: WriterT s m a -> WriterLazyC s m a
+ Control.Effect.Internal.Writer: WriterLazyC :: WriterT o m a -> WriterLazyC o m a
- Control.Effect.Internal.Writer: [Listen] :: m a -> Listen s m (s, a)
+ Control.Effect.Internal.Writer: [Listen] :: m a -> Listen o m (o, a)
- Control.Effect.Internal.Writer: [Pass] :: m (s -> s, a) -> Pass s m a
+ Control.Effect.Internal.Writer: [Pass] :: m (o -> o, a) -> Pass o m a
- Control.Effect.Internal.Writer: [Tell] :: s -> Tell s m ()
+ Control.Effect.Internal.Writer: [Tell] :: o -> Tell o m ()
- Control.Effect.Internal.Writer: [_unWriterLazyC] :: WriterLazyC s m a -> WriterT s m a
+ Control.Effect.Internal.Writer: [_unWriterLazyC] :: WriterLazyC o m a -> WriterT o m a
- Control.Effect.Internal.Writer: [unListenC] :: ListenC s m a -> WriterT s m a
+ Control.Effect.Internal.Writer: [unListenC] :: ListenC o m a -> WriterT o m a
- Control.Effect.Internal.Writer: [unListenLazyC] :: ListenLazyC s m a -> WriterT s m a
+ Control.Effect.Internal.Writer: [unListenLazyC] :: ListenLazyC o m a -> WriterT o m a
- Control.Effect.Internal.Writer: [unTellC] :: TellC s m a -> WriterT s m a
+ Control.Effect.Internal.Writer: [unTellC] :: TellC o m a -> WriterT o m a
- Control.Effect.Internal.Writer: [unTellLazyC] :: TellLazyC s m a -> WriterT s m a
+ Control.Effect.Internal.Writer: [unTellLazyC] :: TellLazyC o m a -> WriterT o m a
- Control.Effect.Internal.Writer: [unWriterC] :: WriterC s m a -> WriterT s m a
+ Control.Effect.Internal.Writer: [unWriterC] :: WriterC o m a -> WriterT o m a
- Control.Effect.Internal.Writer: class (forall s. Monoid s => Threads (WriterT s) p) => WriterLazyThreads p
+ Control.Effect.Internal.Writer: class (forall o. Monoid o => Threads (WriterT o) p) => WriterLazyThreads p
- Control.Effect.Internal.Writer: class (forall s. Monoid s => Threads (WriterT s) p) => WriterThreads p
+ Control.Effect.Internal.Writer: class (forall o. Monoid o => Threads (WriterT o) p) => WriterThreads p
- Control.Effect.Internal.Writer: data Listen s m a
+ Control.Effect.Internal.Writer: data Listen o :: Effect
- Control.Effect.Internal.Writer: data Tell s m a
+ Control.Effect.Internal.Writer: data Tell o :: Effect
- Control.Effect.Internal.Writer: newtype ListenC s m a
+ Control.Effect.Internal.Writer: newtype ListenC o m a
- Control.Effect.Internal.Writer: newtype ListenLazyC s m a
+ Control.Effect.Internal.Writer: newtype ListenLazyC o m a
- Control.Effect.Internal.Writer: newtype TellC s m a
+ Control.Effect.Internal.Writer: newtype TellC o m a
- Control.Effect.Internal.Writer: newtype TellLazyC s m a
+ Control.Effect.Internal.Writer: newtype TellLazyC o m a
- Control.Effect.Internal.Writer: newtype WriterC s m a
+ Control.Effect.Internal.Writer: newtype WriterC o m a
- Control.Effect.Internal.Writer: newtype WriterLazyC s m a
+ Control.Effect.Internal.Writer: newtype WriterLazyC o m a
- Control.Effect.Mask: data Mask m a
+ Control.Effect.Mask: data Mask :: Effect
- Control.Effect.NonDet: data Cut m a
+ Control.Effect.NonDet: data Cut :: Effect
- Control.Effect.NonDet: data Split m a
+ Control.Effect.NonDet: data Split :: Effect
- Control.Effect.NonDet: newtype Cull m a
+ Control.Effect.NonDet: newtype Cull :: Effect
- Control.Effect.NonDet: newtype NonDet m a
+ Control.Effect.NonDet: newtype NonDet :: Effect
- Control.Effect.Optional: data Optional s m a
+ Control.Effect.Optional: data Optional s :: Effect
- Control.Effect.Reader: data Ask i m a
+ Control.Effect.Reader: data Ask i :: Effect
- Control.Effect.Reader: data Local i m a
+ Control.Effect.Reader: data Local i :: Effect
- Control.Effect.Regional: data Regional s m a
+ Control.Effect.Regional: data Regional s :: Effect
- Control.Effect.State: data State s m a
+ Control.Effect.State: data State s :: Effect
- Control.Effect.Trace: class (forall s. Monoid s => Threads (WriterT s) p) => WriterThreads p
+ Control.Effect.Trace: class (forall o. Monoid o => Threads (WriterT o) p) => WriterThreads p
- Control.Effect.Trace: data Trace m a
+ Control.Effect.Trace: data Trace :: Effect
- Control.Effect.Type.Alt: data Alt m a
+ Control.Effect.Type.Alt: data Alt (m :: * -> *) a
- Control.Effect.Type.Bracket: data Bracket m a
+ Control.Effect.Type.Bracket: data Bracket :: Effect
- Control.Effect.Type.Catch: data Catch e m a
+ Control.Effect.Type.Catch: data Catch e :: Effect
- Control.Effect.Type.Embed: newtype Embed b m a
+ Control.Effect.Type.Embed: newtype Embed b (m :: * -> *) a
- Control.Effect.Type.ErrorIO: data ErrorIO m a
+ Control.Effect.Type.ErrorIO: data ErrorIO (m :: * -> *) a
- Control.Effect.Type.Fail: newtype Fail m a
+ Control.Effect.Type.Fail: newtype Fail (m :: * -> *) (a :: *)
- Control.Effect.Type.Fix: newtype Fix m a
+ Control.Effect.Type.Fix: newtype Fix :: Effect
- Control.Effect.Type.ListenPrim: [ListenPrimListen] :: m a -> ListenPrim w m (w, a)
+ Control.Effect.Type.ListenPrim: [ListenPrimListen] :: m a -> ListenPrim o m (o, a)
- Control.Effect.Type.ListenPrim: [ListenPrimTell] :: w -> ListenPrim w m ()
+ Control.Effect.Type.ListenPrim: [ListenPrimTell] :: o -> ListenPrim o m ()
- Control.Effect.Type.ListenPrim: data ListenPrim w m a
+ Control.Effect.Type.ListenPrim: data ListenPrim o :: Effect
- Control.Effect.Type.ListenPrim: threadListenPrim :: forall w t m a. (MonadTrans t, Monad m) => (forall x. (forall y. ListenPrim w m y -> m y) -> t m x -> t m (w, x)) -> (forall x. ListenPrim w m x -> m x) -> ListenPrim w (t m) a -> t m a
+ Control.Effect.Type.ListenPrim: threadListenPrim :: forall o t m a. (MonadTrans t, Monad m) => (forall x. (forall y. ListenPrim o m y -> m y) -> t m x -> t m (o, x)) -> (forall x. ListenPrim o m x -> m x) -> ListenPrim o (t m) a -> t m a
- Control.Effect.Type.ListenPrim: threadListenPrimViaClass :: forall w t m a. (Monoid w, Monad m) => (RepresentationalT t, MonadTrans t, forall b. MonadWriter w b => MonadWriter w (t b)) => (forall x. ListenPrim w m x -> m x) -> ListenPrim w (t m) a -> t m a
+ Control.Effect.Type.ListenPrim: threadListenPrimViaClass :: forall o t m a. (Monoid o, Monad m) => (RepresentationalT t, MonadTrans t, forall b. MonadWriter o b => MonadWriter o (t b)) => (forall x. ListenPrim o m x -> m x) -> ListenPrim o (t m) a -> t m a
- Control.Effect.Type.Mask: data Mask m a
+ Control.Effect.Type.Mask: data Mask :: Effect
- Control.Effect.Type.Optional: data Optional s m a
+ Control.Effect.Type.Optional: data Optional s :: Effect
- Control.Effect.Type.ReaderPrim: data ReaderPrim i m a
+ Control.Effect.Type.ReaderPrim: data ReaderPrim i :: Effect
- Control.Effect.Type.Regional: data Regional s m a
+ Control.Effect.Type.Regional: data Regional s :: Effect
- Control.Effect.Type.Split: data Split m a
+ Control.Effect.Type.Split: data Split :: Effect
- Control.Effect.Type.Throw: newtype Throw e m a
+ Control.Effect.Type.Throw: newtype Throw e (m :: * -> *) (a :: *)
- Control.Effect.Type.WriterPrim: [WriterPrimListen] :: m a -> WriterPrim w m (w, a)
+ Control.Effect.Type.WriterPrim: [WriterPrimListen] :: m a -> WriterPrim o m (o, a)
- Control.Effect.Type.WriterPrim: [WriterPrimPass] :: m (w -> w, a) -> WriterPrim w m a
+ Control.Effect.Type.WriterPrim: [WriterPrimPass] :: m (o -> o, a) -> WriterPrim o m a
- Control.Effect.Type.WriterPrim: [WriterPrimTell] :: w -> WriterPrim w m ()
+ Control.Effect.Type.WriterPrim: [WriterPrimTell] :: o -> WriterPrim o m ()
- Control.Effect.Type.WriterPrim: algListenPrimIntoWriterPrim :: Algebra' (ListenPrim w : p) m a -> (m (w -> w, a) -> m a) -> Algebra' (WriterPrim w : p) m a
+ Control.Effect.Type.WriterPrim: algListenPrimIntoWriterPrim :: Algebra' (ListenPrim o : p) m a -> (m (o -> o, a) -> m a) -> Algebra' (WriterPrim o : p) m a
- Control.Effect.Type.WriterPrim: data WriterPrim w m a
+ Control.Effect.Type.WriterPrim: data WriterPrim o :: Effect
- Control.Effect.Type.WriterPrim: threadWriterPrim :: forall w t m a. (MonadTrans t, ThreadsEff t (ListenPrim w), Monad m) => ((forall x. WriterPrim w m x -> m x) -> t m (w -> w, a) -> t m a) -> (forall x. WriterPrim w m x -> m x) -> WriterPrim w (t m) a -> t m a
+ Control.Effect.Type.WriterPrim: threadWriterPrim :: forall o t m a. (MonadTrans t, ThreadsEff t (ListenPrim o), Monad m) => ((forall x. WriterPrim o m x -> m x) -> t m (o -> o, a) -> t m a) -> (forall x. WriterPrim o m x -> m x) -> WriterPrim o (t m) a -> t m a
- Control.Effect.Type.WriterPrim: threadWriterPrimViaClass :: forall w t m a. (Monoid w, MonadTrans t, Monad m) => (RepresentationalT t, forall b. MonadWriter w b => MonadWriter w (t b)) => (forall x. WriterPrim w m x -> m x) -> WriterPrim w (t m) a -> t m a
+ Control.Effect.Type.WriterPrim: threadWriterPrimViaClass :: forall o t m a. (Monoid o, MonadTrans t, Monad m) => (RepresentationalT t, forall b. MonadWriter o b => MonadWriter o (t b)) => (forall x. WriterPrim o m x -> m x) -> WriterPrim o (t m) a -> t m a
- Control.Effect.Writer: [Listen] :: m a -> Listen s m (s, a)
+ Control.Effect.Writer: [Listen] :: m a -> Listen o m (o, a)
- Control.Effect.Writer: [Pass] :: m (s -> s, a) -> Pass s m a
+ Control.Effect.Writer: [Pass] :: m (o -> o, a) -> Pass o m a
- Control.Effect.Writer: [Tell] :: s -> Tell s m ()
+ Control.Effect.Writer: [Tell] :: o -> Tell o m ()
- Control.Effect.Writer: censor :: Eff (Pass s) m => (s -> s) -> m a -> m a
+ Control.Effect.Writer: censor :: Eff (Pass o) m => (o -> o) -> m a -> m a
- Control.Effect.Writer: class (forall s. Monoid s => Threads (WriterT s) p) => WriterLazyThreads p
+ Control.Effect.Writer: class (forall o. Monoid o => Threads (WriterT o) p) => WriterLazyThreads p
- Control.Effect.Writer: class (forall s. Monoid s => Threads (WriterT s) p) => WriterThreads p
+ Control.Effect.Writer: class (forall o. Monoid o => Threads (WriterT o) p) => WriterThreads p
- Control.Effect.Writer: data Listen s m a
+ Control.Effect.Writer: data Listen o :: Effect
- Control.Effect.Writer: data ListenC s m a
+ Control.Effect.Writer: data ListenC o m a
- Control.Effect.Writer: data ListenLazyC s m a
+ Control.Effect.Writer: data ListenLazyC o m a
- Control.Effect.Writer: data Tell s m a
+ Control.Effect.Writer: data Tell o :: Effect
- Control.Effect.Writer: data TellC s m a
+ Control.Effect.Writer: data TellC o m a
- Control.Effect.Writer: data TellLazyC s m a
+ Control.Effect.Writer: data TellLazyC o m a
- Control.Effect.Writer: data WriterC s m a
+ Control.Effect.Writer: data WriterC o m a
- Control.Effect.Writer: data WriterLazyC s m a
+ Control.Effect.Writer: data WriterLazyC o m a
- Control.Effect.Writer: fromEndoWriter :: (Monoid s, Functor f) => f (Endo s, a) -> f (s, a)
+ Control.Effect.Writer: fromEndoWriter :: (Monoid o, Functor f) => f (Endo o, a) -> f (o, a)
- Control.Effect.Writer: listen :: Eff (Listen s) m => m a -> m (s, a)
+ Control.Effect.Writer: listen :: Eff (Listen o) m => m a -> m (o, a)
- Control.Effect.Writer: listenIntoEndoListen :: (Monoid s, HeadEffs '[Listen (Endo s), Tell (Endo s)] m) => ListenIntoEndoListenC s m a -> m a
+ Control.Effect.Writer: listenIntoEndoListen :: (Monoid o, HeadEffs '[Listen (Endo o), Tell (Endo o)] m) => ListenIntoEndoListenC o m a -> m a
- Control.Effect.Writer: listenToIO :: forall s m a p. (Monoid s, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => ListenTVarC s m a -> m (s, a)
+ Control.Effect.Writer: listenToIO :: forall o m a p. (Monoid o, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => ListenTVarC o m a -> m (o, a)
- Control.Effect.Writer: pass :: Eff (Pass s) m => m (s -> s, a) -> m a
+ Control.Effect.Writer: pass :: Eff (Pass o) m => m (o -> o, a) -> m a
- Control.Effect.Writer: runListen :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterThreads] m p) => ListenC s m a -> m (s, a)
+ Control.Effect.Writer: runListen :: forall o m a p. (Monoid o, Carrier m, Threaders '[WriterThreads] m p) => ListenC o m a -> m (o, a)
- Control.Effect.Writer: runListenLazy :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterThreads] m p) => ListenLazyC s m a -> m (s, a)
+ Control.Effect.Writer: runListenLazy :: forall o m a p. (Monoid o, Carrier m, Threaders '[WriterThreads] m p) => ListenLazyC o m a -> m (o, a)
- Control.Effect.Writer: runListenTVar :: forall s m a p. (Monoid s, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => TVar s -> ListenTVarC s m a -> m a
+ Control.Effect.Writer: runListenTVar :: forall o m a p. (Monoid o, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => TVar o -> ListenTVarC o m a -> m a
- Control.Effect.Writer: runTell :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterThreads] m p) => TellC s m a -> m (s, a)
+ Control.Effect.Writer: runTell :: forall o m a p. (Monoid o, Carrier m, Threaders '[WriterThreads] m p) => TellC o m a -> m (o, a)
- Control.Effect.Writer: runTellIORef :: forall s m a. (Monoid s, Eff (Embed IO) m) => IORef s -> InterpretReifiedC (Tell s) m a -> m a
+ Control.Effect.Writer: runTellIORef :: forall o m a. (Monoid o, Eff (Embed IO) m) => IORef o -> InterpretReifiedC (Tell o) m a -> m a
- Control.Effect.Writer: runTellIORefSimple :: forall s m a p. (Monoid s, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => IORef s -> InterpretSimpleC (Tell s) m a -> m a
+ Control.Effect.Writer: runTellIORefSimple :: forall o m a p. (Monoid o, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => IORef o -> InterpretSimpleC (Tell o) m a -> m a
- Control.Effect.Writer: runTellLazy :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterLazyThreads] m p) => TellLazyC s m a -> m (s, a)
+ Control.Effect.Writer: runTellLazy :: forall o m a p. (Monoid o, Carrier m, Threaders '[WriterLazyThreads] m p) => TellLazyC o m a -> m (o, a)
- Control.Effect.Writer: runTellList :: forall s m a p. (Carrier m, Threaders '[WriterThreads] m p) => TellListC s m a -> m ([s], a)
+ Control.Effect.Writer: runTellList :: forall o m a p. (Carrier m, Threaders '[WriterThreads] m p) => TellListC o m a -> m ([o], a)
- Control.Effect.Writer: runTellListLazy :: forall s m a p. (Carrier m, Threaders '[WriterLazyThreads] m p) => TellListLazyC s m a -> m ([s], a)
+ Control.Effect.Writer: runTellListLazy :: forall o m a p. (Carrier m, Threaders '[WriterLazyThreads] m p) => TellListLazyC o m a -> m ([o], a)
- Control.Effect.Writer: runTellTVar :: forall s m a. (Monoid s, Eff (Embed IO) m) => TVar s -> InterpretReifiedC (Tell s) m a -> m a
+ Control.Effect.Writer: runTellTVar :: forall o m a. (Monoid o, Eff (Embed IO) m) => TVar o -> InterpretReifiedC (Tell o) m a -> m a
- Control.Effect.Writer: runTellTVarSimple :: forall s m a p. (Monoid s, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => TVar s -> InterpretSimpleC (Tell s) m a -> m a
+ Control.Effect.Writer: runTellTVarSimple :: forall o m a p. (Monoid o, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => TVar o -> InterpretSimpleC (Tell o) m a -> m a
- Control.Effect.Writer: runWriter :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterThreads] m p) => WriterC s m a -> m (s, a)
+ Control.Effect.Writer: runWriter :: forall o m a p. (Monoid o, Carrier m, Threaders '[WriterThreads] m p) => WriterC o m a -> m (o, a)
- Control.Effect.Writer: runWriterLazy :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterLazyThreads] m p) => WriterLazyC s m a -> m (s, a)
+ Control.Effect.Writer: runWriterLazy :: forall o m a p. (Monoid o, Carrier m, Threaders '[WriterLazyThreads] m p) => WriterLazyC o m a -> m (o, a)
- Control.Effect.Writer: runWriterTVar :: forall s m a p. (Monoid s, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => TVar s -> WriterTVarC s m a -> m a
+ Control.Effect.Writer: runWriterTVar :: forall o m a p. (Monoid o, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => TVar o -> WriterTVarC o m a -> m a
- Control.Effect.Writer: tell :: Eff (Tell s) m => s -> m ()
+ Control.Effect.Writer: tell :: Eff (Tell o) m => o -> m ()
- Control.Effect.Writer: tellIntoEndoTell :: (Monoid s, HeadEff (Tell (Endo s)) m) => TellIntoEndoTellC s m a -> m a
+ Control.Effect.Writer: tellIntoEndoTell :: (Monoid o, HeadEff (Tell (Endo o)) m) => TellIntoEndoTellC o m a -> m a
- Control.Effect.Writer: tellIntoTell :: forall s t m a. HeadEff (Tell t) m => (s -> t) -> ReinterpretReifiedC (Tell s) '[Tell t] m a -> m a
+ Control.Effect.Writer: tellIntoTell :: forall o o' m a. HeadEff (Tell o') m => (o -> o') -> ReinterpretReifiedC (Tell o) '[Tell o'] m a -> m a
- Control.Effect.Writer: tellIntoTellSimple :: forall s t m a p. (HeadEff (Tell t) m, Threaders '[ReaderThreads] m p) => (s -> t) -> ReinterpretSimpleC (Tell s) '[Tell t] m a -> m a
+ Control.Effect.Writer: tellIntoTellSimple :: forall o o' m a p. (HeadEff (Tell o') m, Threaders '[ReaderThreads] m p) => (o -> o') -> ReinterpretSimpleC (Tell o) '[Tell o'] m a -> m a
- Control.Effect.Writer: tellToIO :: forall s m a. (Monoid s, Eff (Embed IO) m) => InterpretReifiedC (Tell s) m a -> m (s, a)
+ Control.Effect.Writer: tellToIO :: forall o m a. (Monoid o, Eff (Embed IO) m) => InterpretReifiedC (Tell o) m a -> m (o, a)
- Control.Effect.Writer: tellToIOSimple :: forall s m a p. (Monoid s, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => InterpretSimpleC (Tell s) m a -> m (s, a)
+ Control.Effect.Writer: tellToIOSimple :: forall o m a p. (Monoid o, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => InterpretSimpleC (Tell o) m a -> m (o, a)
- Control.Effect.Writer: tellToTell :: forall s t m a. Eff (Tell t) m => (s -> t) -> InterpretReifiedC (Tell s) m a -> m a
+ Control.Effect.Writer: tellToTell :: forall o o' m a. Eff (Tell o') m => (o -> o') -> InterpretReifiedC (Tell o) m a -> m a
- Control.Effect.Writer: tellToTellSimple :: forall s t m a p. (Eff (Tell t) m, Threaders '[ReaderThreads] m p) => (s -> t) -> InterpretSimpleC (Tell s) m a -> m a
+ Control.Effect.Writer: tellToTellSimple :: forall o o' m a p. (Eff (Tell o') m, Threaders '[ReaderThreads] m p) => (o -> o') -> InterpretSimpleC (Tell o) m a -> m a
- Control.Effect.Writer: type ListenIntoEndoListenC s = CompositionC '[IntroC '[Listen s, Tell s] '[Listen (Endo s), Tell (Endo s)], InterpretC WriterToEndoWriterH (Listen s), InterpretC WriterToEndoWriterH (Tell s)]
+ Control.Effect.Writer: type ListenIntoEndoListenC o = CompositionC '[IntroC '[Listen o, Tell o] '[Listen (Endo o), Tell (Endo o)], InterpretC WriterToEndoWriterH (Listen o), InterpretC WriterToEndoWriterH (Tell o)]
- Control.Effect.Writer: type ListenTVarC s = CompositionC '[IntroC '[Listen s, Tell s] '[ListenPrim s, Local (s -> STM ()), Ask (s -> STM ())], InterpretC WriterTVarH (Listen s), InterpretC WriterTVarH (Tell s), InterpretPrimC WriterTVarH (ListenPrim s), ReaderC (s -> STM ())]
+ Control.Effect.Writer: type ListenTVarC o = CompositionC '[IntroC '[Listen o, Tell o] '[ListenPrim o, Local (o -> STM ()), Ask (o -> STM ())], InterpretC WriterTVarH (Listen o), InterpretC WriterTVarH (Tell o), InterpretPrimC WriterTVarH (ListenPrim o), ReaderC (o -> STM ())]
- Control.Effect.Writer: type TellIntoEndoTellC s = ReinterpretC WriterToEndoWriterH (Tell s) '[Tell (Endo s)]
+ Control.Effect.Writer: type TellIntoEndoTellC o = ReinterpretC WriterToEndoWriterH (Tell o) '[Tell (Endo o)]
- Control.Effect.Writer: type TellListC s = CompositionC '[ReinterpretC TellListH (Tell s) '[Tell (Dual [s])], TellC (Dual [s])]
+ Control.Effect.Writer: type TellListC o = CompositionC '[ReinterpretC TellListH (Tell o) '[Tell (Dual [o])], TellC (Dual [o])]
- Control.Effect.Writer: type TellListLazyC s = CompositionC '[ReinterpretC TellListLazyH (Tell s) '[Tell (Endo [s])], TellLazyC (Endo [s])]
+ Control.Effect.Writer: type TellListLazyC o = CompositionC '[ReinterpretC TellListLazyH (Tell o) '[Tell (Endo [o])], TellLazyC (Endo [o])]
- Control.Effect.Writer: type Writer s = Bundle '[Tell s, Listen s, Pass s]
+ Control.Effect.Writer: type Writer o = Bundle '[Tell o, Listen o, Pass o]
- Control.Effect.Writer: type WriterIntoEndoWriterC s = CompositionC '[IntroC '[Pass s, Listen s, Tell s] '[Pass (Endo s), Listen (Endo s), Tell (Endo s)], InterpretC WriterToEndoWriterH (Pass s), InterpretC WriterToEndoWriterH (Listen s), InterpretC WriterToEndoWriterH (Tell s)]
+ Control.Effect.Writer: type WriterIntoEndoWriterC o = CompositionC '[IntroC '[Pass o, Listen o, Tell o] '[Pass (Endo o), Listen (Endo o), Tell (Endo o)], InterpretC WriterToEndoWriterH (Pass o), InterpretC WriterToEndoWriterH (Listen o), InterpretC WriterToEndoWriterH (Tell o)]
- Control.Effect.Writer: type WriterTVarC s = CompositionC '[IntroC '[Pass s, Listen s, Tell s] '[ListenPrim s, WriterPrim s, Local (s -> STM ()), Ask (s -> STM ())], InterpretC WriterTVarH (Pass s), InterpretC WriterTVarH (Listen s), InterpretC WriterTVarH (Tell s), InterpretC WriterTVarH (ListenPrim s), InterpretPrimC WriterTVarH (WriterPrim s), ReaderC (s -> STM ())]
+ Control.Effect.Writer: type WriterTVarC o = CompositionC '[IntroC '[Pass o, Listen o, Tell o] '[ListenPrim o, WriterPrim o, Local (o -> STM ()), Ask (o -> STM ())], InterpretC WriterTVarH (Pass o), InterpretC WriterTVarH (Listen o), InterpretC WriterTVarH (Tell o), InterpretC WriterTVarH (ListenPrim o), InterpretPrimC WriterTVarH (WriterPrim o), ReaderC (o -> STM ())]
- Control.Effect.Writer: type WriterToBracketC s = CompositionC '[IntroC '[Pass s, Listen s, Tell s] '[Local (s -> STM ()), Ask (s -> STM ())], InterpretC WriterToBracketH (Pass s), InterpretC WriterToBracketH (Listen s), InterpretC WriterTVarH (Tell s), ReaderC (s -> STM ())]
+ Control.Effect.Writer: type WriterToBracketC o = CompositionC '[IntroC '[Pass o, Listen o, Tell o] '[Local (o -> STM ()), Ask (o -> STM ())], InterpretC WriterToBracketH (Pass o), InterpretC WriterToBracketH (Listen o), InterpretC WriterTVarH (Tell o), ReaderC (o -> STM ())]
- Control.Effect.Writer: writerIntoEndoWriter :: (Monoid s, HeadEffs '[Pass (Endo s), Listen (Endo s), Tell (Endo s)] m) => WriterIntoEndoWriterC s m a -> m a
+ Control.Effect.Writer: writerIntoEndoWriter :: (Monoid o, HeadEffs '[Pass (Endo o), Listen (Endo o), Tell (Endo o)] m) => WriterIntoEndoWriterC o m a -> m a
- Control.Effect.Writer: writerToBracket :: forall s m a p. (Monoid s, Effs [Embed IO, Bracket] m, Threaders '[ReaderThreads] m p) => WriterToBracketC s m a -> m (s, a)
+ Control.Effect.Writer: writerToBracket :: forall o m a p. (Monoid o, Effs [Embed IO, Bracket] m, Threaders '[ReaderThreads] m p) => WriterToBracketC o m a -> m (o, a)
- Control.Effect.Writer: writerToBracketTVar :: forall s m a p. (Monoid s, Effs [Embed IO, Bracket] m, Threaders '[ReaderThreads] m p) => TVar s -> WriterToBracketC s m a -> m a
+ Control.Effect.Writer: writerToBracketTVar :: forall o m a p. (Monoid o, Effs [Embed IO, Bracket] m, Threaders '[ReaderThreads] m p) => TVar o -> WriterToBracketC o m a -> m a
- Control.Effect.Writer: writerToIO :: forall s m a p. (Monoid s, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => WriterTVarC s m a -> m (s, a)
+ Control.Effect.Writer: writerToIO :: forall o m a p. (Monoid o, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => WriterTVarC o m a -> m (o, a)
Files
- ChangeLog.md +5/−0
- README.md +1/−0
- in-other-words.cabal +4/−2
- src/Control/Effect/Alt.hs +1/−0
- src/Control/Effect/AtomicState.hs +2/−2
- src/Control/Effect/Carrier/Internal/Interpret.hs +39/−3
- src/Control/Effect/Carrier/Internal/Intro.hs +12/−2
- src/Control/Effect/Carrier/Internal/Stepped.hs +5/−1
- src/Control/Effect/Conc.hs +2/−2
- src/Control/Effect/Cont.hs +4/−3
- src/Control/Effect/Embed.hs +37/−0
- src/Control/Effect/Error.hs +4/−4
- src/Control/Effect/Exceptional.hs +1/−1
- src/Control/Effect/Fail.hs +2/−2
- src/Control/Effect/Fix.hs +2/−2
- src/Control/Effect/Fresh.hs +11/−3
- src/Control/Effect/Intercept.hs +1/−1
- src/Control/Effect/Internal.hs +2/−2
- src/Control/Effect/Internal/Cont.hs +14/−13
- src/Control/Effect/Internal/Derive.hs +1/−0
- src/Control/Effect/Internal/Error.hs +2/−2
- src/Control/Effect/Internal/Newtype.hs +2/−2
- src/Control/Effect/Internal/NonDet.hs +5/−5
- src/Control/Effect/Internal/Reader.hs +3/−3
- src/Control/Effect/Internal/State.hs +5/−5
- src/Control/Effect/Internal/Union.hs +4/−3
- src/Control/Effect/Internal/Writer.hs +89/−89
- src/Control/Effect/NonDet.hs +7/−7
- src/Control/Effect/Select.hs +1/−2
- src/Control/Effect/State.hs +5/−0
- src/Control/Effect/Trace.hs +1/−1
- src/Control/Effect/Type/Alt.hs +1/−1
- src/Control/Effect/Type/Bracket.hs +1/−1
- src/Control/Effect/Type/Catch.hs +1/−1
- src/Control/Effect/Type/Embed.hs +1/−1
- src/Control/Effect/Type/ErrorIO.hs +1/−1
- src/Control/Effect/Type/Fail.hs +1/−1
- src/Control/Effect/Type/Fix.hs +1/−1
- src/Control/Effect/Type/ListenPrim.hs +31/−31
- src/Control/Effect/Type/Mask.hs +1/−1
- src/Control/Effect/Type/Optional.hs +1/−1
- src/Control/Effect/Type/ReaderPrim.hs +2/−2
- src/Control/Effect/Type/Regional.hs +1/−1
- src/Control/Effect/Type/Split.hs +2/−2
- src/Control/Effect/Type/Throw.hs +1/−1
- src/Control/Effect/Type/Unlift.hs +1/−1
- src/Control/Effect/Type/WriterPrim.hs +36/−36
- src/Control/Effect/Writer.hs +366/−310
- test/ContSpec.hs +51/−0
ChangeLog.md view
@@ -1,4 +1,9 @@ # Changelog for `in-other-words` +## 0.1.1.0 (2020-10-30) +* Added `runTellAction` and `ignoreTell` interpreters. +* Added `runEmbed` interpreter +* Fixed an issue with `runShift` where HO-actions applied on a `shift` could affect the continuation provided to the argument of `shift`. + ## 0.1.0.0 (2020-10-10) Initial release.
README.md view
@@ -1,4 +1,5 @@ # in-other-words+[](https://hackage.haskell.org/package/in-other-words) [](https://github.com/KingoftheHomeless/in-other-words/actions?query=workflow%3A%22build+GHC+8.6%22) [](https://github.com/KingoftheHomeless/in-other-words/actions?query=workflow%3A%22build+GHC+8.8%22) [](https://github.com/KingoftheHomeless/in-other-words/actions?query=workflow%3A%22build+GHC+8.10%22)
in-other-words.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 391e1bf43205bfa3b9719626f8fbbd2f7e5d117aa180b0780022450a404f75de+-- hash: 9c937a4927f283035de5f46009187006236169a826b849566821564b47613a53 name: in-other-words-version: 0.1.0.0+version: 0.1.1.0 synopsis: A higher-order effect system where the sky's the limit description: A low-boilerplate effect system with easy higher-order effects and very high expressive power category: Control@@ -20,6 +20,7 @@ build-type: Simple extra-source-files: README.md+ ChangeLog.md library exposed-modules:@@ -122,6 +123,7 @@ main-is: Main.hs other-modules: BracketSpec+ ContSpec ErrorSpec NonDetSpec WriterSpec
src/Control/Effect/Alt.hs view
@@ -117,6 +117,7 @@ -- effect it interprets. -- -- @'Derivs' ('AltMaybeC' m) = 'Alt' ': 'Derivs' m@+-- -- @'Prims' ('AltMaybeC' m) = 'Control.Effect.Optional.Optional' ((->) ()) ': 'Prims' m@ runAltMaybe :: forall m a p . ( Threaders '[ErrorThreads] m p
src/Control/Effect/AtomicState.hs view
@@ -52,7 +52,7 @@ -- -- Convention: the interpreter for the @AtomicState@ action must force -- the resulting tuple of the function, but not the end state or returned value.-data AtomicState s m a where+data AtomicState s :: Effect where AtomicState :: (s -> (s, a)) -> AtomicState s m a AtomicGet :: AtomicState s m s @@ -75,7 +75,7 @@ -- | Read the state. -- -- Depending on the interperation of 'AtomicState', this--- can be more efficient than @'atomicState' (\s -> (s,s))@+-- can be more efficient than @'atomicState' (\\s -> (s,s))@ atomicGet :: Eff (AtomicState s) m => m s atomicGet = send AtomicGet {-# INLINE atomicGet #-}
src/Control/Effect/Carrier/Internal/Interpret.hs view
@@ -169,7 +169,7 @@ -- carrier @m@. -- -- Unlike 'EffHandler's, 'EffPrimHandler's have direct access to @m@,--- giving them significantly more powerful.+-- making them significantly more powerful. -- -- That said, __you should interpret your own effects as primitives only as a__ -- __last resort.__ Every primitive effect comes at the cost of enormous amounts@@ -377,6 +377,10 @@ -- See 'EffHandler' for more information about the handler you pass to -- this function. --+-- @'Derivs' ('InterpretReifiedC' e m) = e ': 'Derivs' m@+--+-- @'Prims' ('InterpretReifiedC' e m) = 'Prims' m@+-- -- This has a higher-rank type, as it makes use of 'InterpretReifiedC'. -- __This makes 'interpret' very difficult to use partially applied.__ -- __In particular, it can't be composed using @'.'@.__ You must use@@ -425,6 +429,10 @@ -- See 'EffHandler' for more information about the handler you pass to -- this function. --+-- @'Derivs' ('InterpretSimpleC' e m) = e ': 'Derivs' m@+--+-- @'Prims' ('InterpretSimpleC' e m) = 'Prims' m@+-- -- This is a significantly slower variant of 'interpret' that doesn't have -- a higher-ranked type, making it much easier to use partially applied. --@@ -479,6 +487,10 @@ -- making it easier to use partially applied, and unlike -- 'interpretSimple' doesn't sacrifice performance. --+-- @'Derivs' ('InterpretC' h e m) = e ': 'Derivs' m@+--+-- @'Prims' ('InterpretC' h e m) = 'Prims' m@+-- -- Example usage: -- -- @@@ -521,9 +533,13 @@ -- | Interpret an effect as a new primitive effect. ----- __*Only interpret your own effects as primitives as a last resort.__+-- __Only interpret your own effects as primitives as a last resort.__ -- See 'EffPrimHandler'. --+-- @'Derivs' ('InterpretPrimReifiedC' e m) = e ': 'Derivs' m@+--+-- @'Prims' ('InterpretPrimReifiedC' e m) = e ': 'Prims' m@+-- -- This has a higher-rank type, as it makes use of 'InterpretPrimReifiedC'. -- __This makes 'interpretPrim' very difficult to use partially applied.__ -- __In particular, it can't be composed using @'.'@.__ You must use@@ -551,7 +567,11 @@ -- -- __Only interpret your own effects as primitives as a last resort.__ -- See 'EffPrimHandler'.+---+-- @'Derivs' ('InterpretPrimC' h e m) = e ': 'Derivs' m@ --+-- @'Prims' ('InterpretPrimC' h e m) = e ': 'Prims' m@+-- -- Unlike 'interpretPrim', this does not have a higher-rank type, -- making it easier to use partially applied, and unlike -- 'interpretPrimSimple' doesn't sacrifice performance.@@ -566,9 +586,13 @@ -- | A significantly slower variant of 'interpretPrim' that doesn't have -- a higher-ranked type, making it much easier to use partially applied. ----- __*Only interpret your own effects as primitives as a last resort.__+-- __Only interpret your own effects as primitives as a last resort.__ -- See 'EffPrimHandler'. --+-- @'Derivs' ('InterpretPrimSimpleC' e m) = e ': 'Derivs' m@+--+-- @'Prims' ('InterpretPrimSimpleC' e m) = e ': 'Prims' m@+-- -- Note the @ReaderThreads '[e]@ constraint, meaning -- you need to define a @ThreadsEff e (ReaderT i)@ instance in order -- to use 'interpretPrimSimple'.@@ -650,6 +674,10 @@ -- This combines 'interpret' and 'introUnder' in order to introduce the effects -- @new@ under @e@, which you then may make use of inside the handler for @e@. --+-- @'Derivs' ('ReinterpretReifiedC' e new m) = e ': 'StripPrefix' new ('Derivs' m)@+--+-- @'Prims' ('ReinterpretReifiedC' e new m) = 'Prims' m@+-- -- This has a higher-rank type, as it makes use of 'ReinterpretReifiedC'. -- __This makes 'reinterpret' very difficult to use partially applied.__ -- __In particular, it can't be composed using @'.'@.__ You must use@@ -676,6 +704,10 @@ -- the effects @new@ under @e@, which you then may make use of inside the handler -- for @e@. --+-- @'Derivs' ('ReinterpretC' h e new m) = e ': 'StripPrefix' new ('Derivs' m)@+--+-- @'Prims' ('ReinterpretC' h e new m) = 'Prims' m@+-- -- Unlike 'reinterpret', this does not have a higher-rank type, -- making it easier to use partially applied, and unlike -- 'reinterpretSimple' doesn't sacrifice performance.@@ -714,6 +746,10 @@ -- This combines 'interpretSimple' and 'introUnder' in order to introduce -- the effects @new@ under @e@, which you then may make use of inside the -- handler for @e@.+--+-- @'Derivs' ('ReinterpretSimpleC' e new m) = e ': 'StripPrefix' new ('Derivs' m)@+--+-- @'Prims' ('ReinterpretSimpleC' e new m) = 'Prims' m@ -- -- This is a significantly slower variant of 'reinterpret' that doesn't have -- a higher-ranked type, making it much easier to use partially applied.
src/Control/Effect/Carrier/Internal/Intro.hs view
@@ -88,7 +88,9 @@ -- | Introduce multiple effects under a number of top effects of the effect -- stack -- or rather, reveal those effects which were previously hidden. ----- @'Derivs' ('IntroC' top new m) = Append top ('Control.Effect.Carrier.StripPrefix' (Append top new) ('Derivs' m))@+-- @'Derivs' ('IntroUnderManyC' top new m) = Append top ('Control.Effect.Carrier.StripPrefix' (Append top new) ('Derivs' m))@+--+-- @'Prims' ('IntroUnderManyC' top new m) = 'Prims' m@ introUnderMany :: forall top new m a . ( KnownList top , KnownList new@@ -103,6 +105,8 @@ -- -- or rather, reveal those effects which were previously hidden. -- -- @'Derivs' ('IntroUnderC' e new m) = e ': 'Control.Effect.Carrier.StripPrefix' (e ': new) ('Derivs' m)@+--+-- @'Prims' ('IntroUnderC' e new m) = 'Prims' m@ introUnder :: forall new e m a . ( KnownList new , IntroConsistent '[e] new m@@ -116,6 +120,8 @@ -- -- or rather, reveal that effect which was previously hidden. -- -- @'Derivs' ('IntroUnderC' e '[new] m) = e ': 'Control.Effect.Carrier.StripPrefix' [e, new] ('Derivs' m)@+--+-- @'Prims' ('IntroUnderC' e '[new] m) = 'Prims' m@ introUnder1 :: forall new e m a . IntroConsistent '[e] '[new] m => IntroUnderC e '[new] m a@@ -127,6 +133,8 @@ -- -- or rather, reveal effects previously hidden. -- -- @'Derivs' ('IntroTopC' new m) = 'Control.Effect.Carrier.StripPrefix' new ('Derivs' m)@+--+-- @'Prims' ('IntroTopC' new m) = 'Prims' m@ intro :: forall new m a . ( KnownList new , IntroConsistent '[] new m@@ -139,7 +147,9 @@ -- | Introduce an effect at the top of the stack -- or rather, reveal an effect -- previously hidden. ----- @'Derivs' ('IntroTopC' [e] m) = 'Control.Effect.Carrier.StripPrefix' '[e] ('Derivs' m)@+-- @'Derivs' ('IntroTopC' '[e] m) = 'Control.Effect.Carrier.StripPrefix' '[e] ('Derivs' m)@+--+-- @'Prims' ('IntroTopC' '[e] m) = 'Prims' m@ intro1 :: forall e m a . IntroConsistent '[] '[e] m => IntroTopC '[e] m a
src/Control/Effect/Carrier/Internal/Stepped.hs view
@@ -75,6 +75,10 @@ -- | Run the __first-order__ effect @e@ by breaking the computation using it -- into steps, where each step is seperated by the use of an action of @e@.+--+-- @'Derivs' ('SteppedC' e m) = e ': 'Derivs' m@+--+-- @'Control.Effect.Primitive.Prims' ('SteppedC' e m) = 'Control.Effect.Primitive.Prims' m@ steps :: forall e m a p . ( Carrier m , Threaders '[SteppedThreads] m p@@ -106,6 +110,6 @@ -- * 'Control.Effect.Regional.Regional' @s@ -- * 'Control.Effect.Optional.Optional' @s@ (when @s@ is a functor) -- * 'Control.Effect.Type.Unravel.Unravel' @p@--- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid')+-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid') -- * 'Control.Effect.Type.ReaderPrim.ReaderPrim' @i@ type SteppedThreads = FreeThreads
src/Control/Effect/Conc.hs view
@@ -122,7 +122,7 @@ -- 'Control.Effect.NonDet.NonDet'. -- In that case, you might sitll be able to use both effects in the same program -- by applying--- [/Split Interpretation/](https://github.com/KingoftheHomeless/in-other-words/wiki/Advanced-Topics#split-interpretation)+-- [Split Interpretation](https://github.com/KingoftheHomeless/in-other-words/wiki/Advanced-Topics#split-interpretation) -- to seperate their uses. -- -- @'Derivs' ('ConcToIOC' m) = 'Conc' ': 'Derivs' m@@@ -306,7 +306,7 @@ {-# INLINE forConcurrently_ #-} replicateConcurrently :: Eff Conc m => Int -> m a -> m [a]-replicateConcurrently cnt = runConcurrently #. replicateM cnt .# Concurrently+replicateConcurrently cnt = runConcurrently #. replicateM cnt .# Concurrently {-# INLINE replicateConcurrently #-} replicateConcurrently_ :: Eff Conc m => Int -> m a -> m ()
src/Control/Effect/Cont.hs view
@@ -84,7 +84,7 @@ -- -- @'Derivs' ('ContC' r m) = 'Cont' ': 'Derivs' m@ ----- @'Control.Effect.Primitive.Prims' ('ContC' r m) = 'Prims' m@+-- @'Control.Effect.Primitive.Prims' ('ContC' r m) = 'Control.Effect.Primitive.Prims' m@ runCont :: forall a m p . ( Carrier m , Threaders '[ContThreads] m p@@ -94,7 +94,8 @@ foldFreeT id (\c -> \case- Exit a -> a+ Exit a -> pure a+ Attempt m -> m >>= c GetCont -> c $ Left (c . Right) ) .# unContC@@ -135,7 +136,7 @@ -- | Run a @'Shift' r@ effect if the program returns @r@. ----- Compared to 'runCont', this is quite a bit faster, but is significantly more+-- Compared to 'runShift', this is quite a bit faster, but is significantly more -- restrictive in what interpreters are used after it, since there are very -- few primitive effects that the carrier for 'runContFast' is able to thread. -- In fact, of all the primitive effects provided by this library, only
src/Control/Effect/Embed.hs view
@@ -8,6 +8,7 @@ -- * Interpreters , runM+ , runEmbed , embedToEmbed @@ -20,10 +21,12 @@ -- * Carriers , RunMC(RunMC)+ , EmbedC(EmbedC) , EmbedToMonadBaseC , EmbedToMonadIOC ) where +import Data.Coerce import Control.Applicative import Control.Monad import Control.Monad.Fix@@ -65,6 +68,40 @@ algDerivs u = RunMC (unEmbed (extract u)) {-# INLINE algDerivs #-}++newtype EmbedC m a = EmbedC { unEmbedC :: m a }+ deriving ( Functor, Applicative, Monad+ , Alternative, MonadPlus+ , MonadFix, Fail.MonadFail, MonadIO+ , MonadThrow, MonadCatch, MonadMask+ , MonadBase b, MonadBaseControl b+ )+ deriving (MonadTrans, MonadTransControl) via IdentityT++-- | Run an @'Embed' m@ effect, where the embedded monad @m@ is the current monad.+--+-- Not to be confused with 'runM'. This is simply an interpreter for @'Embed' m@;+-- it doesn't extract the final monad.+--+-- @'Derivs' ('EmbedC' m) = 'Embed' m ': 'Derivs' m@+--+-- @'Prims' ('EmbedC' m) = 'Prims' m@+runEmbed :: Carrier m => EmbedC m a -> m a+runEmbed = unEmbedC+{-# INLINE runEmbed #-}++instance Carrier m => Carrier (EmbedC m) where+ type Derivs (EmbedC m) = Embed m ': Derivs m+ type Prims (EmbedC m) = Prims m++ algPrims = coerce (algPrims @m)+ {-# INLINEABLE algPrims #-}++ reformulate n alg = powerAlg (reformulate (n .# EmbedC) alg) (n .# EmbedC .# unEmbed)+ {-# INLINE reformulate #-}++ algDerivs = powerAlg (coerce (algDerivs @m)) (EmbedC .# unEmbed)+ {-# INLINEABLE algDerivs #-} -- | Extract the final monad @m@ from a computation of which -- no effects remain to be handled except for @'Embed' m@.
src/Control/Effect/Error.hs view
@@ -126,7 +126,7 @@ -- -- @'Derivs' ('ThrowC' e m) = 'Throw' e ': 'Derivs' m@ ----- @'Control.Effect.Primitive.Prims' ('ThrowC' e m) = 'Control.Effect.Primitive.Prims' m@+-- @'Control.Effect.Primitive.Prims' ('ThrowC' e m) = 'Control.Effect.Primitive.Prims' m@ runThrow :: forall e m a p . ( Carrier m , Threaders '[ErrorThreads] m p@@ -140,7 +140,7 @@ -- -- @'Derivs' ('ErrorC' e m) = 'Catch' e ': 'Throw' e ': 'Derivs' m@ ----- @'Control.Effect.Primitive.Prims' ('ErrorC' e m) = 'Control.Effect.Optional.Optional' ((->) e) ': 'Control.Effect.Primitive.Prims' m@+-- @'Control.Effect.Primitive.Prims' ('ErrorC' e m) = 'Control.Effect.Optional.Optional' ((->) e) ': 'Control.Effect.Primitive.Prims' m@ runError :: forall e m a p . ( Carrier m , Threaders '[ErrorThreads] m p@@ -321,7 +321,7 @@ -- -- @'Derivs' ('ErrorToIOC' e m) = 'Catch' e ': 'Throw' e ': 'Derivs' m@ ----- @'Control.Effect.Primitive.Prims' ('ErrorToIOC' e m) = 'Control.Effect.Optional.Optional' ((->) 'Control.Exception.SomeException') ': 'Control.Effect.Primitive.Prims' m@+-- @'Control.Effect.Primitive.Prims' ('ErrorToIOC' e m) = 'Control.Effect.Optional.Optional' ((->) 'Control.Exception.SomeException') ': 'Control.Effect.Primitive.Prims' m@ -- -- This has a higher-rank type, as it makes use of 'ErrorToIOC'. -- __This makes 'errorToIO' very difficult to use partially applied.__@@ -449,7 +449,7 @@ -- -- @'Derivs' ('ErrorToIOSimpleC' e m) = 'Catch' e ': 'Throw' e ': 'Derivs' m@ ----- @'Control.Effect.Primitive.Prims' ('ErrorToIOSimpleC' e m) = 'Control.Effect.Optional.Optional' ((->) 'Control.Exception.SomeException') ': 'Control.Effect.Primitive.Prims' m@+-- @'Control.Effect.Primitive.Prims' ('ErrorToIOSimpleC' e m) = 'Control.Effect.Optional.Optional' ((->) 'Control.Exception.SomeException') ': 'Control.Effect.Primitive.Prims' m@ -- -- This is a less performant version of 'errorToIO' that doesn't have -- a higher-rank type, making it much easier to use partially applied.
src/Control/Effect/Exceptional.hs view
@@ -179,7 +179,7 @@ -- -- caringProgram :: 'Eff' ('Exceptional' SomeEffect SomeEffectExc) m => m String -- caringProgram =--- 'catching' @eff uncaringProgram (\(exc :: SomeEffectExc) -> handlerForSomeEffectExc exc)+-- 'catching' \@eff uncaringProgram (\\(exc :: SomeEffectExc) -> handlerForSomeEffectExc exc) -- @ -- catching :: forall eff exc m a
src/Control/Effect/Fail.hs view
@@ -84,7 +84,7 @@ -- For example: -- -- @--- 'failToThrow' (\_ -> 'throw' exc) (do { Just a <- pure Nothing; return a})+-- 'failToThrow' (\\_ -> 'throw' exc) (do { Just a <- pure Nothing; return a}) -- = 'throw' exc -- @ --@@ -169,7 +169,7 @@ -- | Run a 'Fail' effect purely, by returning @Left failureMessage@ -- upon a pattern match failure. ----- 'FailC' has an 'Alternative' instance based on the 'Alt'+-- 'FailC' has an 'MonadFail' instance based on the 'Fail' -- effect it interprets. runFail :: forall m a p . ( Threaders '[ErrorThreads] m p
src/Control/Effect/Fix.hs view
@@ -31,9 +31,9 @@ -- | Run a 'Fix' effect if the final monad and -- all carriers transforming it are 'MonadFix'. ----- @'Derivs' (FixToFinalC m) = 'Fix' ': 'Derivs' m@+-- @'Derivs' ('FixToFinalC' m) = 'Fix' ': 'Derivs' m@ ----- @'Prims' (FixToFinalC m) = 'Fix' ': 'Prims' m@+-- @'Prims' ('FixToFinalC' m) = 'Fix' ': 'Prims' m@ fixToFinal :: ( Carrier m , MonadFix m )
src/Control/Effect/Fresh.hs view
@@ -43,9 +43,9 @@ -- to place constraints upon @uniq@ as necessary. -- -- Any interpreter for 'Fresh' has the responsibilty of ensuring--- that any call to 'fresh' produces an object that /never/+-- that any call to 'fresh' produces an object that __never__ -- compares equal to an object produced by a previous call to 'fresh'.-data Fresh uniq m a where+data Fresh uniq :: Effect where Fresh :: Fresh uniq m uniq fresh :: Eff (Fresh uniq) m => m uniq@@ -62,6 +62,10 @@ type FreshToIOC = InterpretC FreshToIOH (Fresh Unique) -- | Runs a 'Fresh' effect through generating 'Unique's using 'IO'.+--+-- @'Derivs' ('FreshToIOC' m) = 'Fresh' 'Unique' ': 'Derivs' m@+--+-- @'Control.Effect.Primitive.Prims' ('FreshToIOC' m) = 'Control.Effect.Primitive.Prims' m@ freshToIO :: Eff (Embed IO) m => FreshToIOC m a -> m a@@ -135,7 +139,11 @@ -- of local state. This includes 'Control.Effect.Error.errorToIO' and -- 'Control.Effect.Conc.asyncToIO'. ----- Prefer 'freshToIO' whenever possible.+-- Prefer 'freshToIO' or 'runFreshEnumIO' whenever possible.+--+-- @'Derivs' ('FreshEnumC' uniq m) = 'Fresh' uniq ': 'Derivs' m@+--+-- @'Control.Effect.Primitive.Prims' ('FreshEnumC' uniq m) = 'Control.Effect.Primitive.Prims' m@ runFreshEnum :: forall uniq m a p . ( Enum uniq , Threaders '[StateThreads] m p
src/Control/Effect/Intercept.hs view
@@ -47,7 +47,7 @@ interceptCont h m = send (InterceptCont InterceptAll h m) {-# INLINE interceptCont #-} --- | Intercept only the _first_ use of an effect within a region --+-- | Intercept only the /first/ use of an effect within a region -- -- and at that use-site, capture the continuation of the argument computation, -- and also allow for early abortion (by not invoking the continuation). interceptCont1 :: Eff (InterceptCont e) m
src/Control/Effect/Internal.hs view
@@ -158,7 +158,7 @@ -- The ability of a monad transformer to lift handlers of a particular -- primitive effect is called /threading/ that effect. /Threading constraints/ -- correspond to the requirement that the primitive effects of the monad that's--- being transformed can be thread by certain monad transformer.+-- being transformed can be thread by certain monad transformers. -- -- For example, the 'Control.Effect.State.runState' places the threading -- constraint 'Control.Effect.State.StateThreads' on @'Prims' m@, so that@@ -171,7 +171,7 @@ -- 'Control.Effect.Error.runError' with the carrier @m@. -- -- Sometimes, you may want to have a local effect which you interpret--- inside of application code; such as a local 'Control.Effect.State.State'+-- inside of application code, such as a local 'Control.Effect.State.State' -- or 'Control.Effect.Error.Error' effect. In such cases, /try to use/ -- [split interpretation](https://github.com/KingoftheHomeless/in-other-words/wiki/Advanced-Topics#abstract-effect-interpretation) /instead of using interpreters with threading constraints/ -- /inside of application code./ If you can't, then using 'Threaders'
src/Control/Effect/Internal/Cont.hs view
@@ -29,12 +29,13 @@ newtype Shift r m a where Shift :: ((a -> m r) -> m r) -> Shift r m a -data ContBase r a where - Exit :: r -> ContBase r a - GetCont :: ContBase r (Either (a -> r) a) +data ContBase mr r a where + Exit :: r -> ContBase mr r a + Attempt :: mr -> ContBase mr r r + GetCont :: ContBase mr r (Either (a -> mr) a) -newtype ContC r m a = ContC { unContC :: FreeT (ContBase (m r)) m a } +newtype ContC r m a = ContC { unContC :: FreeT (ContBase (m r) r) m a } deriving ( Functor, Applicative, Monad , MonadBase b, Fail.MonadFail, MonadIO , MonadThrow, MonadCatch @@ -45,18 +46,18 @@ {-# INLINE lift #-} instance ( Carrier m - , Threads (FreeT (ContBase (m r))) (Prims m) + , Threads (FreeT (ContBase (m r) r)) (Prims m) ) => Carrier (ContC r m) where type Derivs (ContC r m) = Cont ': Derivs m type Prims (ContC r m) = Prims m - algPrims = coerce (thread @(FreeT (ContBase (m r))) (algPrims @m)) + algPrims = coerce (thread @(FreeT (ContBase (m r) r)) (algPrims @m)) {-# INLINEABLE algPrims #-} reformulate n alg = powerAlg (reformulate (n . lift) alg) $ \case CallCC main -> n (ContC $ liftF $ GetCont) >>= \case - Left c -> main (n . ContC #. liftF . Exit . c) + Left c -> main (\x -> n $ ContC $ liftF (Attempt (c x)) >>= liftF . Exit) Right a -> return a {-# INLINEABLE reformulate #-} @@ -82,7 +83,7 @@ Right a -> return a {-# INLINEABLE reformulate #-} -newtype ShiftC r m a = ShiftC { unShiftC :: FreeT (ContBase (m r)) m a } +newtype ShiftC r m a = ShiftC { unShiftC :: FreeT (ContBase (m r) r) m a } deriving ( Functor, Applicative, Monad , MonadBase b, Fail.MonadFail, MonadIO , MonadThrow, MonadCatch @@ -93,19 +94,19 @@ {-# INLINE lift #-} instance ( Carrier m - , Threads (FreeT (ContBase (m r))) (Prims m) + , Threads (FreeT (ContBase (m r) r)) (Prims m) ) => Carrier (ShiftC r m) where type Derivs (ShiftC r m) = Shift r ': Derivs m type Prims (ShiftC r m) = Prims m - algPrims = coerce (thread @(FreeT (ContBase (m r))) (algPrims @m)) + algPrims = coerce (thread @(FreeT (ContBase (m r) r)) (algPrims @m)) {-# INLINEABLE algPrims #-} reformulate n alg = powerAlg (reformulate (n . lift) alg) $ \case Shift main -> n (ShiftC $ liftF $ GetCont) >>= \case - Left c -> main (n . lift . c) >>= \r -> - n (ShiftC $ liftF $ Exit (pure r)) + Left c -> main (\x -> n $ ShiftC $ liftF $ Attempt (c x)) >>= \r -> + n (ShiftC $ liftF $ Exit r) Right a -> return a {-# INLINEABLE reformulate #-} @@ -136,7 +137,7 @@ -- * 'Control.Effect.Regional.Regional' @s@ -- * 'Control.Effect.Optional.Optional' @s@ (when @s@ is a functor) -- * 'Control.Effect.Type.Unravel.Unravel' @p@ --- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid') +-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid') -- * 'Control.Effect.Type.ReaderPrim.ReaderPrim' @i@ type ContThreads = FreeThreads
src/Control/Effect/Internal/Derive.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_HADDOCK not-home #-} -- | Module exporting typical type classes that are newtype-derived by Carriers module Control.Effect.Internal.Derive ( Alternative, MonadPlus
src/Control/Effect/Internal/Error.hs view
@@ -74,8 +74,8 @@ -- * 'Control.Effect.Optional.Optional' @s@ (when @s@ is a functor) -- * 'Control.Effect.BaseControl.BaseControl' @b@ -- * 'Control.Effect.Type.Unravel.Unravel' @p@--- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid')--- * 'Control.Effect.Type.WriterPrim.WriterPrim' @s@ (when @s@ is a 'Monoid')+-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid')+-- * 'Control.Effect.Type.WriterPrim.WriterPrim' @o@ (when @o@ is a 'Monoid') -- * 'Control.Effect.Type.ReaderPrim.ReaderPrim' @i@ -- * 'Control.Effect.Mask.Mask' -- * 'Control.Effect.Bracket.Bracket'
src/Control/Effect/Internal/Newtype.hs view
@@ -74,7 +74,7 @@ -- newtype Counter m a = Counter ('Control.Effect.State.State' Int m) -- -- probe :: Eff Counter m => m Int--- probe = 'wrapWith' Counter $ 'Control.Effect.State.state'' \@Int (\s -> (s + 1, s))+-- probe = 'wrapWith' Counter $ 'Control.Effect.State.state'' \@Int (\\s -> (s + 1, s)) -- @ -- wrapWith :: ( Member e (Derivs m)@@ -183,7 +183,7 @@ -- -- @ -- newtype SomeWrapper m a = SomeWrapper (SomeEffect m a)--- deriving 'EffNewtype' via SomeWrapper `'WrapperOf'` SomeEffect+-- deriving 'EffNewtype' via SomeWrapper \`'WrapperOf'\` SomeEffect -- @ newtype WrapperOf (e :: Effect) (e' :: Effect) m a = WrapperOf (e m a)
src/Control/Effect/Internal/NonDet.hs view
@@ -15,15 +15,15 @@ import qualified Control.Monad.Trans.List.Church as L -- | An effect for nondeterministic computations-newtype NonDet m a where+newtype NonDet :: Effect where FromList :: [a] -> NonDet m a -- | An effect for culling nondeterministic computations.-newtype Cull m a where+newtype Cull :: Effect where Cull :: m a -> Cull m a -- | An effect to delimit backtracking within nondeterministic contexts.-data Cut m a where+data Cut :: Effect where Cutfail :: Cut m a Call :: m a -> Cut m a @@ -39,8 +39,8 @@ -- * 'Control.Effect.Regional.Regional' @s@ -- * 'Control.Effect.Optional.Optional' @s@ (when @s@ is a functor) -- * 'Control.Effect.Type.Unravel.Unravel' @p@--- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid')--- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid')+-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid')+-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid') -- * 'Control.Effect.Type.ReaderPrim.ReaderPrim' @i@ type NonDetThreads = Threads L.ListT
src/Control/Effect/Internal/Reader.hs view
@@ -11,13 +11,13 @@ import Control.Monad.Trans.Reader (ReaderT(..)) import qualified Control.Monad.Trans.Reader as R --- | An effect for gaining access to information. -data Ask i m a where +-- | An effect for arbitrary input +data Ask i :: Effect where Ask :: Ask i m i -- | An effect for locally modifying an environment -- used to gain access to information. -data Local i m a where +data Local i :: Effect where Local :: (i -> i) -> m a -> Local i m a -- | A pseudo-effect for connected @'Ask' i@ and @'Local' i@ effects.
src/Control/Effect/Internal/State.hs view
@@ -13,7 +13,7 @@ -- -- If you need atomicity, use 'Control.Effect.AtomicState.AtomicState' -- instead.-data State s m a where+data State s :: Effect where Get :: State s m s Put :: s -> State s m () @@ -70,8 +70,8 @@ -- * 'Control.Effect.Regional.Regional' @s@ -- * 'Control.Effect.Optional.Optional' @s@ (when @s@ is a functor) -- * 'Control.Effect.BaseControl.BaseControl' @b@--- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid')--- * 'Control.Effect.Type.WriterPrim.WriterPrim' @s@ (when @s@ is a 'Monoid')+-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid')+-- * 'Control.Effect.Type.WriterPrim.WriterPrim' @o@ (when @o@ is a 'Monoid') -- * 'Control.Effect.Type.ReaderPrim.ReaderPrim' @i@ -- * 'Control.Effect.Mask.Mask' -- * 'Control.Effect.Bracket.Bracket'@@ -87,8 +87,8 @@ -- * 'Control.Effect.Regional.Regional' @s@ -- * 'Control.Effect.Optional.Optional' @s@ (when @s@ is a functor) -- * 'Control.Effect.BaseControl.BaseControl' @b@--- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid')--- * 'Control.Effect.Type.WriterPrim.WriterPrim' @s@ (when @s@ is a 'Monoid')+-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid')+-- * 'Control.Effect.Type.WriterPrim.WriterPrim' @o@ (when @o@ is a 'Monoid') -- * 'Control.Effect.Type.ReaderPrim.ReaderPrim' @i@ -- * 'Control.Effect.Mask.Mask' -- * 'Control.Effect.Bracket.Bracket'
src/Control/Effect/Internal/Union.hs view
@@ -52,7 +52,8 @@ -- | 'RepresentationalEff' is the constraint every effect is expected -- to satisfy: namely, that any effect @e m a@ is representational in @m@, -- which -- in practice -- means that no constraints are ever placed upon--- @m@ within the definion of @e@.+-- @m@ within the definion of @e@, and that @m@ isn't present in+-- the return type of any action of @e@. -- -- You don't need to make instances of 'RepresentationalEff'; the compiler -- will automatically infer if your effect satisfies it.@@ -183,9 +184,9 @@ -> e (t m) a -> t m a --- | @'Threads' t p@ is satisfied if @ThreadsEff t e@ instances are defined for+-- | @'Threads' t p@ is satisfied if @'ThreadsEff' t e@ instances are defined for -- each effect @e@ in @p@. By using the @'Threads' t p@ constraint, you're--- able to lift 'Algebra's over p from any monad @m@ to @t m@. This is useful+-- able to lift 'Algebra's over @p@ from any monad @m@ to @t m@. This is useful -- when defining custom 'Control.Effect.Carrier.Carrier' instances. -- -- Note that you /should not/ place a @'Threads' t p@ constraint if @t@ is
src/Control/Effect/Internal/Writer.hs view
@@ -25,39 +25,39 @@ import Control.Effect.Internal.Utils -- | An effect for arbitrary output.-data Tell s m a where- Tell :: s -> Tell s m ()+data Tell o :: Effect where+ Tell :: o -> Tell o m () -- | An effect for hearing what a computation -- has to 'Control.Effect.Writer.tell'.-data Listen s m a where- Listen :: m a -> Listen s m (s, a)+data Listen o :: Effect where+ Listen :: m a -> Listen o m (o, a) -- | An effect for altering what a computation -- 'Control.Effect.Writer.tell's.-data Pass s m a where- Pass :: m (s -> s, a) -> Pass s m a+newtype Pass o :: Effect where+ Pass :: m (o -> o, a) -> Pass o m a -newtype TellC s m a = TellC {- unTellC :: WriterT s m a+newtype TellC o m a = TellC {+ unTellC :: WriterT o m a } deriving ( Functor, Applicative, Monad , Alternative, MonadPlus , MonadFix, MonadFail, MonadIO )- via WriterT s m- deriving MonadTrans via (WriterT s)+ via WriterT o m+ deriving MonadTrans via (WriterT o) -instance MonadThrow m => MonadThrow (TellC s m) where+instance MonadThrow m => MonadThrow (TellC o m) where throwM = lift . C.throwM {-# INLINEABLE throwM #-} -instance (Monoid s, MonadCatch m) => MonadCatch (TellC s m) where+instance (Monoid o, MonadCatch m) => MonadCatch (TellC o m) where catch (TellC m) h = TellC $ writerT $ runWriterT m `C.catch` (runWriterT . unTellC #. h) {-# INLINEABLE catch #-} -instance (Monoid s, MonadMask m) => MonadMask (TellC s m) where+instance (Monoid o, MonadMask m) => MonadMask (TellC o m) where mask main = TellC $ writerT $ C.mask $ \restore -> runWriterT (unTellC (main (TellC #. W.mapWriterT restore .# unTellC))) {-# INLINEABLE mask #-}@@ -68,21 +68,21 @@ generalBracket acquire release use = coerceAlg- (threadEff @(WriterT s) @_ @m+ (threadEff @(WriterT o) @_ @m (\(GeneralBracket a r u) -> C.generalBracket a r u) ) (GeneralBracket acquire release use) {-# INLINEABLE generalBracket #-} -instance MonadBase b m => MonadBase b (TellC s m) where+instance MonadBase b m => MonadBase b (TellC o m) where liftBase = lift . liftBase {-# INLINEABLE liftBase #-} instance ( MonadBaseControl b m- , Monoid s+ , Monoid o )- => MonadBaseControl b (TellC s m) where- type StM (TellC s m) a = StM m (a, s)+ => MonadBaseControl b (TellC o m) where+ type StM (TellC o m) a = StM m (a, o) liftBaseWith = defaultLiftBaseWith {-# INLINEABLE liftBaseWith #-}@@ -90,8 +90,8 @@ restoreM = defaultRestoreM {-# INLINEABLE restoreM #-} -instance Monoid s => MonadTransControl (TellC s) where- type StT (TellC s) a = (a, s)+instance Monoid o => MonadTransControl (TellC o) where+ type StT (TellC o) a = (a, o) liftWith main = lift (main (runWriterT .# unTellC)) {-# INLINEABLE liftWith #-}@@ -100,23 +100,23 @@ {-# INLINEABLE restoreT #-} instance ( Carrier m- , Monoid s- , Threads (WriterT s) (Prims m)+ , Monoid o+ , Threads (WriterT o) (Prims m) )- => Carrier (TellC s m) where- type Derivs (TellC s m) = Tell s ': Derivs m- type Prims (TellC s m) = Prims m+ => Carrier (TellC o m) where+ type Derivs (TellC o m) = Tell o ': Derivs m+ type Prims (TellC o m) = Prims m - algPrims = coerceAlg (thread @(WriterT s) (algPrims @m))+ algPrims = coerceAlg (thread @(WriterT o) (algPrims @m)) {-# INLINEABLE algPrims #-} reformulate n alg = powerAlg (reformulate (n . lift) alg) $ \case- Tell s -> n (TellC (W.tell s))+ Tell o -> n (TellC (W.tell o)) {-# INLINEABLE reformulate #-} -newtype ListenC s m a = ListenC {- unListenC :: WriterT s m a+newtype ListenC o m a = ListenC {+ unListenC :: WriterT o m a } deriving ( Functor, Applicative, Monad , Alternative, MonadPlus@@ -124,37 +124,37 @@ , MonadThrow, MonadCatch, MonadMask , MonadBase b, MonadBaseControl b )- via TellC s m- deriving (MonadTrans, MonadTransControl) via (TellC s)+ via TellC o m+ deriving (MonadTrans, MonadTransControl) via (TellC o) instance ( Carrier m- , Monoid s- , Threads (WriterT s) (Prims m)+ , Monoid o+ , Threads (WriterT o) (Prims m) )- => Carrier (ListenC s m) where- type Derivs (ListenC s m) = Listen s ': Tell s ': Derivs m- type Prims (ListenC s m) = ListenPrim s ': Prims m+ => Carrier (ListenC o m) where+ type Derivs (ListenC o m) = Listen o ': Tell o ': Derivs m+ type Prims (ListenC o m) = ListenPrim o ': Prims m algPrims = powerAlg (- coerce (algPrims @(TellC s m))+ coerce (algPrims @(TellC o m)) ) $ \case- ListenPrimTell s -> ListenC $ W.tell s+ ListenPrimTell o -> ListenC $ W.tell o ListenPrimListen (ListenC m) -> ListenC $ do- (a, s) <- W.listen m- return (s, a)+ (a, o) <- W.listen m+ return (o, a) {-# INLINEABLE algPrims #-} reformulate n alg = powerAlg (- coerceReform (reformulate @(TellC s m)) n (weakenAlg alg)+ coerceReform (reformulate @(TellC o m)) n (weakenAlg alg) ) $ \case Listen m -> (alg . inj) $ ListenPrimListen m {-# INLINEABLE reformulate #-} -newtype WriterC s m a = WriterC {- unWriterC :: WriterT s m a+newtype WriterC o m a = WriterC {+ unWriterC :: WriterT o m a } deriving ( Functor, Applicative, Monad , Alternative, MonadPlus@@ -162,20 +162,20 @@ , MonadThrow, MonadCatch, MonadMask , MonadBase b, MonadBaseControl b )- via TellC s m- deriving (MonadTrans, MonadTransControl) via (TellC s)+ via TellC o m+ deriving (MonadTrans, MonadTransControl) via (TellC o) instance ( Carrier m- , Monoid s- , Threads (WriterT s) (Prims m)+ , Monoid o+ , Threads (WriterT o) (Prims m) )- => Carrier (WriterC s m) where- type Derivs (WriterC s m) = Pass s ': Listen s ': Tell s ': Derivs m- type Prims (WriterC s m) = WriterPrim s ': Prims m+ => Carrier (WriterC o m) where+ type Derivs (WriterC o m) = Pass o ': Listen o ': Tell o ': Derivs m+ type Prims (WriterC o m) = WriterPrim o ': Prims m algPrims = algListenPrimIntoWriterPrim (- coerce (algPrims @(ListenC s m))+ coerce (algPrims @(ListenC o m)) ) $ \(WriterC m) -> WriterC $ W.pass $ do (f, a) <- m return (a, f)@@ -184,7 +184,7 @@ reformulate n alg = powerAlg ( powerAlg (- coerceReform (reformulate @(TellC s m)) n (weakenAlg alg)+ coerceReform (reformulate @(TellC o m)) n (weakenAlg alg) ) $ \case Listen m -> (alg . inj) $ WriterPrimListen m ) $ \case@@ -192,8 +192,8 @@ {-# INLINEABLE reformulate #-} -newtype TellLazyC s m a = TellLazyC {- unTellLazyC :: LW.WriterT s m a+newtype TellLazyC o m a = TellLazyC {+ unTellLazyC :: LW.WriterT o m a } deriving ( Functor, Applicative, Monad , Alternative, MonadPlus@@ -203,23 +203,23 @@ ) deriving (MonadTrans, MonadTransControl) -instance ( Monoid s+instance ( Monoid o , Carrier m- , Threads (LW.WriterT s) (Prims m)+ , Threads (LW.WriterT o) (Prims m) )- => Carrier (TellLazyC s m) where- type Derivs (TellLazyC s m) = Tell s ': Derivs m- type Prims (TellLazyC s m) = Prims m+ => Carrier (TellLazyC o m) where+ type Derivs (TellLazyC o m) = Tell o ': Derivs m+ type Prims (TellLazyC o m) = Prims m - algPrims = coerce (thread @(LW.WriterT s) (algPrims @m))+ algPrims = coerce (thread @(LW.WriterT o) (algPrims @m)) {-# INLINEABLE algPrims #-} reformulate n alg = powerAlg (reformulate (n . lift) alg) $ \case- Tell s -> n $ TellLazyC $ LW.tell s+ Tell o -> n $ TellLazyC $ LW.tell o {-# INLINEABLE reformulate #-} -newtype ListenLazyC s m a = ListenLazyC {- unListenLazyC :: LW.WriterT s m a+newtype ListenLazyC o m a = ListenLazyC {+ unListenLazyC :: LW.WriterT o m a } deriving ( Functor, Applicative, Monad , Alternative, MonadPlus@@ -229,33 +229,33 @@ ) deriving (MonadTrans, MonadTransControl) -instance ( Monoid s+instance ( Monoid o , Carrier m- , Threads (LW.WriterT s) (Prims m)+ , Threads (LW.WriterT o) (Prims m) )- => Carrier (ListenLazyC s m) where- type Derivs (ListenLazyC s m) = Listen s ': Tell s ': Derivs m- type Prims (ListenLazyC s m) = ListenPrim s ': Prims m+ => Carrier (ListenLazyC o m) where+ type Derivs (ListenLazyC o m) = Listen o ': Tell o ': Derivs m+ type Prims (ListenLazyC o m) = ListenPrim o ': Prims m algPrims = powerAlg (- coerce (algPrims @(TellLazyC s m))+ coerce (algPrims @(TellLazyC o m)) ) $ \case- ListenPrimTell w ->- ListenLazyC $ LW.tell w+ ListenPrimTell o ->+ ListenLazyC $ LW.tell o ListenPrimListen (ListenLazyC m) -> ListenLazyC $ swap <$> LW.listen m {-# INLINEABLE algPrims #-} reformulate n alg = powerAlg (- coerceReform (reformulate @(TellLazyC s m)) n (weakenAlg alg)+ coerceReform (reformulate @(TellLazyC o m)) n (weakenAlg alg) ) $ \case Listen m -> (alg . inj) $ ListenPrimListen m {-# INLINEABLE reformulate #-} -newtype WriterLazyC s m a = WriterLazyC {- _unWriterLazyC :: LW.WriterT s m a+newtype WriterLazyC o m a = WriterLazyC {+ _unWriterLazyC :: LW.WriterT o m a } deriving ( Functor, Applicative, Monad , Alternative, MonadPlus@@ -265,24 +265,24 @@ ) deriving (MonadTrans, MonadTransControl) -instance ( Monoid s+instance ( Monoid o , Carrier m- , Threads (LW.WriterT s) (Prims m)+ , Threads (LW.WriterT o) (Prims m) )- => Carrier (WriterLazyC s m) where- type Derivs (WriterLazyC s m) = Pass s ': Listen s ': Tell s ': Derivs m- type Prims (WriterLazyC s m) = WriterPrim s ': Prims m+ => Carrier (WriterLazyC o m) where+ type Derivs (WriterLazyC o m) = Pass o ': Listen o ': Tell o ': Derivs m+ type Prims (WriterLazyC o m) = WriterPrim o ': Prims m algPrims = algListenPrimIntoWriterPrim (- coerce (algPrims @(ListenLazyC s m))+ coerce (algPrims @(ListenLazyC o m)) ) $ \(WriterLazyC m) -> WriterLazyC $ LW.pass (swap <$> m) {-# INLINEABLE algPrims #-} reformulate n alg = powerAlg ( powerAlg (- coerceReform (reformulate @(TellLazyC s m)) n (weakenAlg alg)+ coerceReform (reformulate @(TellLazyC o m)) n (weakenAlg alg) ) $ \case Listen m -> (alg . inj) $ WriterPrimListen m ) $ \case@@ -294,16 +294,16 @@ -- * 'Control.Effect.Regional.Regional' @s@ -- * 'Control.Effect.Optional.Optional' @s@ (when @s@ is a functor) -- * 'Control.Effect.BaseControl.BaseControl' @b@--- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid')--- * 'Control.Effect.Type.WriterPrim.WriterPrim' @s@ (when @s@ is a 'Monoid')+-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid')+-- * 'Control.Effect.Type.WriterPrim.WriterPrim' @o@ (when @o@ is a 'Monoid') -- * 'Control.Effect.Type.ReaderPrim.ReaderPrim' @i@ -- * 'Control.Effect.Mask.Mask' -- * 'Control.Effect.Bracket.Bracket' -- * 'Control.Effect.Fix.Fix' -- * 'Control.Effect.NonDet.Split'-class ( forall s. Monoid s => Threads (WriterT s) p+class ( forall o. Monoid o => Threads (WriterT o) p ) => WriterThreads p-instance ( forall s. Monoid s => Threads (WriterT s) p+instance ( forall o. Monoid o => Threads (WriterT o) p ) => WriterThreads p -- | 'WriterLazyThreads' accepts the following primitive effects:@@ -311,14 +311,14 @@ -- * 'Control.Effect.Regional.Regional' @s@ -- * 'Control.Effect.Optional.Optional' @s@ (when @s@ is a functor) -- * 'Control.Effect.BaseControl.BaseControl' @b@--- * 'Control.Effect.Type.ListenPrim.ListenPrim' @s@ (when @s@ is a 'Monoid')--- * 'Control.Effect.Type.WriterPrim.WriterPrim' @s@ (when @s@ is a 'Monoid')+-- * 'Control.Effect.Type.ListenPrim.ListenPrim' @o@ (when @o@ is a 'Monoid')+-- * 'Control.Effect.Type.WriterPrim.WriterPrim' @o@ (when @o@ is a 'Monoid') -- * 'Control.Effect.Type.ReaderPrim.ReaderPrim' @i@ -- * 'Control.Effect.Mask.Mask' -- * 'Control.Effect.Bracket.Bracket' -- * 'Control.Effect.Fix.Fix' -- * 'Control.Effect.NonDet.Split'-class ( forall s. Monoid s => Threads (LW.WriterT s) p+class ( forall o. Monoid o => Threads (LW.WriterT o) p ) => WriterLazyThreads p-instance ( forall s. Monoid s => Threads (LW.WriterT s) p+instance ( forall o. Monoid o => Threads (LW.WriterT o) p ) => WriterLazyThreads p
src/Control/Effect/NonDet.hs view
@@ -54,7 +54,7 @@ {-# INLINE choose #-} -- | Fail the current branch and proceed to the next branch,--- backtracking to the nearest use of 'choose'/'fromList' that+-- backtracking to the nearest use of 'choose' or 'fromList' that -- still has unprocessed branches. lose :: Eff NonDet m => m a lose = fromList []@@ -63,9 +63,9 @@ -- | Cull nondeterminism in the argument, limiting the number of branches -- it may introduce to be at most 1. ----- @'cull' (return True `'choose'` return False) == return True@+-- @'cull' (return True \`'choose'\` return False) == return True@ ----- @'cull' ('lose' `'choose'` return False) == return False@+-- @'cull' ('lose' \`'choose'\` return False) == return False@ cull :: Eff Cull m => m a -> m a cull = send .# Cull {-# INLINE cull #-}@@ -73,7 +73,7 @@ -- | Fail the current branch, and prevent backtracking up until the nearest -- enclosing use of 'call' (if any). ----- @'cutfail' `'choose'` m == 'cutfail'@+-- @'cutfail' \`'choose'\` m == 'cutfail'@ cutfail :: Eff Cut m => m a cutfail = send Cutfail {-# INLINE cutfail #-}@@ -82,16 +82,16 @@ -- execution to before 'cut' was invoked, up until the nearest enclosing use -- of 'call' (if any). ----- @'call' ('fromList' [1,2] >>= \\a -> 'cut' >> fromList [a,a+3]) == 'fromList' [1,4]@+-- @'call' ('fromList' [1,2] >>= \\a -> 'cut' >> 'fromList' [a,a+3]) == 'fromList' [1,4]@ ----- @ call (('cut' >> return True) `choose` return False) == return True@+-- @'call' (('cut' >> return True) \`'choose'\` return False) == return True@ cut :: Effs '[NonDet, Cut] m => m () cut = pure () `choose` cutfail {-# INLINE cut #-} -- | Delimit the prevention of backtracking from uses of 'cut' and 'cutfail'. ----- @'call' 'cutfail' `'choose'` m = m@+-- @'call' 'cutfail' \`'choose'\` m = m@ call :: Eff Cut m => m a -> m a call = send . Call {-# INLINE call #-}
src/Control/Effect/Select.hs view
@@ -44,8 +44,7 @@ => Handler (SelectH r) (Select s) m where effHandler = \case Select main -> shift @(s, r) $ \c ->- main (\a -> (\(s,r) -> (s, (s, r))) <$> c a)- >>= \t -> shift $ \_ -> return t+ main $ \a -> (\(s,r) -> (s, (s, r))) <$> c a {-# INLINEABLE effHandler #-} type SelectC s r = CompositionC
src/Control/Effect/State.hs view
@@ -47,6 +47,11 @@ import qualified Control.Monad.Trans.State.Strict as SSt import qualified Control.Monad.Trans.State.Lazy as LSt +-- | Read and modify the state.+--+-- The resulting tuple of the computation is forced. You can+-- control what parts of the computation are evaluated by tying+-- their evaluation to the tuple. state :: Eff (State s) m => (s -> (s, a)) -> m a state f = do (s, a) <- f <$> get
src/Control/Effect/Trace.hs view
@@ -48,7 +48,7 @@ -- | An effect for debugging by printing/logging strings.-data Trace m a where+data Trace :: Effect where Trace :: String -> Trace m () -- | Log the provided string
src/Control/Effect/Type/Alt.hs view
@@ -14,6 +14,6 @@ -- how it interprets 'Alt'. This means you can use -- an 'Alt' interpreter to locally gain access to an 'Control.Applicative.Alternative' -- instance inside of application code.-data Alt m a where+data Alt (m :: * -> *) a where Empty :: Alt m a Alt :: m a -> m a -> Alt m a
src/Control/Effect/Type/Bracket.hs view
@@ -42,7 +42,7 @@ -- * 'Control.Effect.Error.ErrorThreads' -- * 'Control.Effect.Writer.WriterThreads' -- * 'Control.Effect.Writer.WriterLazyThreads'-data Bracket m a where+data Bracket :: Effect where GeneralBracket :: m a -> (a -> ExitCase b -> m c) -> (a -> m b)
src/Control/Effect/Type/Catch.hs view
@@ -5,7 +5,7 @@ import Control.Effect.Internal.Union -- | An effect for catching exceptions of type @e@.-data Catch e m a where+data Catch e :: Effect where Catch :: m a -> (e -> m a) -> Catch e m a -- | A pseudo-effect for connected @'Throw' e@ and @'Catch' e@ effects.
src/Control/Effect/Type/Embed.hs view
@@ -2,5 +2,5 @@ module Control.Effect.Type.Embed where -- | An effect for embedding actions of a base monad into the current one. -newtype Embed b m a where +newtype Embed b (m :: * -> *) a where Embed :: { unEmbed :: b a } -> Embed b m a
src/Control/Effect/Type/ErrorIO.hs view
@@ -4,6 +4,6 @@ import Control.Exception -- | An effect for throwing and catching 'IO'-based exceptions. -data ErrorIO m a where +data ErrorIO (m :: * -> *) a where ThrowIO :: Exception e => e -> ErrorIO m a CatchIO :: Exception e => m a -> (e -> m a) -> ErrorIO m a
src/Control/Effect/Type/Fail.hs view
@@ -12,5 +12,5 @@ -- how it interprets 'Fail'. This means you can use -- an 'Fail' interpreter to locally gain access to an 'Control.Monad.Fail.MonadFail' -- instance inside of application code. -newtype Fail m a where +newtype Fail (m :: * -> *) (a :: *) where Fail :: String -> Fail m a
src/Control/Effect/Type/Fix.hs view
@@ -42,7 +42,7 @@ -- * 'Control.Effect.Error.ErrorThreads' -- * 'Control.Effect.Writer.WriterThreads' -- * 'Control.Effect.Writer.WriterLazyThreads'-newtype Fix m a where+newtype Fix :: Effect where Fix :: (a -> m a) -> Fix m a instance ( Reifies s (ReifiedEffAlgebra Fix m)
src/Control/Effect/Type/ListenPrim.hs view
@@ -34,7 +34,7 @@ -- __'ListenPrim' is only used as a primitive effect.__ -- If you define a 'Control.Effect.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). +-- a @'Monoid' o => 'ThreadsEff' t ('ListenPrim' o)@ instance (if possible). -- 'threadListenPrim' and 'threadListenPrimViaClass' can help you with that. -- -- The following threading constraints accept 'ListenPrim': @@ -48,35 +48,35 @@ -- * 'Control.Effect.NonDet.NonDetThreads' -- * 'Control.Effect.Stepped.SteppedThreads' -- * 'Control.Effect.Cont.ContThreads' -data ListenPrim w m a where - ListenPrimTell :: w -> ListenPrim w m () - ListenPrimListen :: m a -> ListenPrim w m (w, a) +data ListenPrim o :: Effect where + ListenPrimTell :: o -> ListenPrim o m () + ListenPrimListen :: m a -> ListenPrim o m (o, a) -- | Construct a valid definition of 'threadEff' for a --- @'ThreadsEff' t ('ListenPrim' w)@ instance +-- @'ThreadsEff' t ('ListenPrim' o)@ instance -- only be specifying how 'ListenPrimListen' should be lifted. -- -- This uses 'lift' to lift 'ListenPrimTell'. -threadListenPrim :: forall w t m a +threadListenPrim :: forall o t m a . (MonadTrans t, Monad m) => ( forall x - . (forall y. ListenPrim w m y -> m y) - -> t m x -> t m (w, x) + . (forall y. ListenPrim o m y -> m y) + -> t m x -> t m (o, x) ) - -> (forall x. ListenPrim w m x -> m x) - -> ListenPrim w (t m) a -> t m a + -> (forall x. ListenPrim o m x -> m x) + -> ListenPrim o (t m) a -> t m a threadListenPrim h alg = \case - ListenPrimTell w -> lift (alg (ListenPrimTell w)) + ListenPrimTell o -> lift (alg (ListenPrimTell o)) ListenPrimListen m -> h alg m {-# INLINE threadListenPrim #-} -instance ( Reifies s (ReifiedEffAlgebra (ListenPrim w) m) - , Monoid w +instance ( Reifies s (ReifiedEffAlgebra (ListenPrim o) m) + , Monoid o , Monad m ) - => MonadWriter w (ViaAlg s (ListenPrim w) m) where - tell w = case reflect @s of - ReifiedEffAlgebra alg -> coerceAlg alg (ListenPrimTell w) + => MonadWriter o (ViaAlg s (ListenPrim o) m) where + tell o = case reflect @s of + ReifiedEffAlgebra alg -> coerceAlg alg (ListenPrimTell o) pass = error "threadListenPrimViaClass: Transformers threading ListenPrim \ \are not allowed to use pass." @@ -86,28 +86,28 @@ fmap (\(s, a) -> (a, s)) $ coerceAlg alg (ListenPrimListen m) {-# INLINE listen #-} --- | A valid definition of 'threadEff' for a @'ThreadsEff' t ('ListenPrim' w)@ +-- | A valid definition of 'threadEff' for a @'ThreadsEff' t ('ListenPrim' o)@ -- 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'. -threadListenPrimViaClass :: forall w t m a - . (Monoid w, Monad m) +threadListenPrimViaClass :: forall o t m a + . (Monoid o, Monad m) => ( RepresentationalT t , MonadTrans t - , forall b. MonadWriter w b => MonadWriter w (t b) + , forall b. MonadWriter o b => MonadWriter o (t b) ) - => (forall x. ListenPrim w m x -> m x) - -> ListenPrim w (t m) a -> t m a + => (forall x. ListenPrim o m x -> m x) + -> ListenPrim o (t m) a -> t m a threadListenPrimViaClass alg = \case - ListenPrimTell w -> lift $ alg (ListenPrimTell w) + ListenPrimTell o -> lift $ alg (ListenPrimTell o) ListenPrimListen m -> reify (ReifiedEffAlgebra alg) $ \(_ :: pr s) -> unViaAlgT - $ fmap (\(a, s) -> (s, a)) + $ fmap (\(a, o) -> (o, a)) $ listen - $ viaAlgT @s @(ListenPrim w) m + $ viaAlgT @s @(ListenPrim o) m {-# INLINE threadListenPrimViaClass #-} #define THREAD_LISTENPRIM(monadT) \ @@ -121,28 +121,28 @@ THREAD_LISTENPRIM(LSt.StateT s) THREAD_LISTENPRIM(SSt.StateT s) -instance Monoid s => ThreadsEff (LWr.WriterT s) (ListenPrim w) where +instance Monoid s => ThreadsEff (LWr.WriterT s) (ListenPrim o) where threadEff = threadListenPrim $ \alg m -> LWr.WriterT - $ fmap (\(s, (a, w)) -> ((s, a), w)) + $ fmap (\(s, (a, o)) -> ((s, a), o)) $ alg $ ListenPrimListen $ LWr.runWriterT m {-# INLINE threadEff #-} -instance Monoid s => ThreadsEff (SWr.WriterT s) (ListenPrim w) where +instance Monoid s => ThreadsEff (SWr.WriterT s) (ListenPrim o) where threadEff = threadListenPrim $ \alg m -> SWr.WriterT - $ fmap (\(s, (a, w)) -> ((s, a), w)) + $ fmap (\(s, (a, o)) -> ((s, a), o)) $ alg $ ListenPrimListen $ SWr.runWriterT m {-# INLINE threadEff #-} -instance Monoid s => ThreadsEff (CPSWr.WriterT s) (ListenPrim w) where +instance Monoid s => ThreadsEff (CPSWr.WriterT s) (ListenPrim o) where threadEff = threadListenPrim $ \alg m -> CPSWr.writerT - $ fmap (\(s, (a, w)) -> ((s, a), w)) + $ fmap (\(s, (a, o)) -> ((s, a), o)) $ alg $ ListenPrimListen $ CPSWr.runWriterT m
src/Control/Effect/Type/Mask.hs view
@@ -43,7 +43,7 @@ -- * 'Control.Effect.Error.ErrorThreads' -- * 'Control.Effect.Writer.WriterThreads' -- * 'Control.Effect.Writer.WriterLazyThreads'-data Mask m a where+data Mask :: Effect where Mask :: MaskMode -> ((forall x. m x -> m x) -> m a) -> Mask m a
src/Control/Effect/Type/Optional.hs view
@@ -62,7 +62,7 @@ -- * 'Control.Effect.NonDet.NonDetThreads' -- * 'Control.Effect.Stepped.SteppedThreads' -- * 'Control.Effect.Cont.ContThreads'-data Optional s m a where+data Optional s :: Effect where Optionally :: s a -> m a -> Optional s m a -- | A valid definition of 'threadEff' for a @'ThreadsEff' ('Regional' s) t@ instance,
src/Control/Effect/Type/ReaderPrim.hs view
@@ -59,7 +59,7 @@ -- * 'Control.Effect.Stepped.SteppedThreads' -- * 'Control.Effect.Cont.ContThreads' -- * 'Control.Effect.Cont.ContFastThreads'-data ReaderPrim i m a where+data ReaderPrim i :: Effect where ReaderPrimAsk :: ReaderPrim i m i ReaderPrimLocal :: (i -> i) -> m a -> ReaderPrim i m a @@ -76,7 +76,7 @@ -- | Construct a valid definition of 'threadEff' for a -- @'ThreadsEff' t ('ReaderPrim' w)@ instance--- only be specifying how 'ReaderPrimLocal' should be lifted.+-- only by specifying how 'ReaderPrimLocal' should be lifted. -- -- This uses 'lift' to lift 'ReaderPrimAsk'. threadReaderPrim :: forall i t m a
src/Control/Effect/Type/Regional.hs view
@@ -51,7 +51,7 @@ -- * 'Control.Effect.NonDet.NonDetThreads' -- * 'Control.Effect.Stepped.SteppedThreads' -- * 'Control.Effect.Cont.ContThreads'-data Regional s m a where+data Regional s :: Effect where Regionally :: s -> m a -> Regional s m a instance ThreadsEff (ExceptT e) (Regional s) where
src/Control/Effect/Type/Split.hs view
@@ -10,7 +10,7 @@ import qualified Control.Monad.Trans.Writer.Strict as SWr import qualified Control.Monad.Trans.Writer.CPS as CPSWr --- | An effect for spliting a nondeterministic computation+-- | An effect for splitting a nondeterministic computation -- into its head and tail. -- -- __'Split' is typically used as a primitive effect.__@@ -26,7 +26,7 @@ -- * 'Control.Effect.State.StateLazyThreads' -- * 'Control.Effect.Writer.WriterThreads' -- * 'Control.Effect.Writer.WriterLazyThreads'-data Split m a where+data Split :: Effect where Split :: (Maybe (a, m a) -> b) -> m a -> Split m b instance ThreadsEff (ReaderT s) Split where
src/Control/Effect/Type/Throw.hs view
@@ -2,6 +2,6 @@ module Control.Effect.Type.Throw where -- | An effect for throwing exceptions of type @e@.-newtype Throw e m a where+newtype Throw e (m :: * -> *) (a :: *) where Throw :: e -> Throw e m a
src/Control/Effect/Type/Unlift.hs view
@@ -85,7 +85,7 @@ -- The following threading constraints accept 'Unlift': -- -- * 'Control.Effect.ReaderThreads'-data Unlift b m a where+newtype Unlift b :: Effect where Unlift :: forall b m a. ((forall x. m x -> b x) -> b a) -> Unlift b m a -- | A valid definition of 'threadEff' for a @'ThreadsEff' ('Unlift' b) t@ instance,
src/Control/Effect/Type/WriterPrim.hs view
@@ -40,7 +40,7 @@ -- __'WriterPrim' is only used as a primitive effect.__ -- If you define a 'Control.Effect.Carrier' that relies on a novel -- non-trivial monad transformer @t@, then you need to make --- a @'Monoid' w => 'ThreadsEff' t ('WriterPrim' w)@ instance (if possible). +-- a @'Monoid' o => 'ThreadsEff' t ('WriterPrim' o)@ instance (if possible). -- 'threadWriterPrim' and 'threadWriterPrimViaClass' can help you with that. -- -- The following threading constraints accept 'WriterPrim': @@ -52,41 +52,41 @@ -- * 'Control.Effect.Writer.WriterThreads' -- * 'Control.Effect.Writer.WriterLazyThreads' -- * 'Control.Effect.NonDet.NonDetThreads' -data WriterPrim w m a where - WriterPrimTell :: w -> WriterPrim w m () - WriterPrimListen :: m a -> WriterPrim w m (w, a) - WriterPrimPass :: m (w -> w, a) -> WriterPrim w m a +data WriterPrim o :: Effect where + WriterPrimTell :: o -> WriterPrim o m () + WriterPrimListen :: m a -> WriterPrim o m (o, a) + WriterPrimPass :: m (o -> o, a) -> WriterPrim o m a -- | Construct a valid definition of 'threadEff' for a --- @'ThreadsEff' t ('WriterPrim' w)@ instance only be specifying how +-- @'ThreadsEff' t ('WriterPrim' o)@ instance only be specifying how -- 'WriterPrimPass' should be lifted. -- --- This relies on an existing @'ThreadsEff' t ('ListenPrim' w)@ instance. -threadWriterPrim :: forall w t m a +-- This relies on an existing @'ThreadsEff' t ('ListenPrim' o)@ instance. +threadWriterPrim :: forall o t m a . ( MonadTrans t - , ThreadsEff t (ListenPrim w) + , ThreadsEff t (ListenPrim o) , Monad m ) - => ( (forall x. WriterPrim w m x -> m x) - -> t m (w -> w, a) -> t m a + => ( (forall x. WriterPrim o m x -> m x) + -> t m (o -> o, a) -> t m a ) - -> (forall x. WriterPrim w m x -> m x) - -> WriterPrim w (t m) a -> t m a + -> (forall x. WriterPrim o m x -> m x) + -> WriterPrim o (t m) a -> t m a threadWriterPrim h alg = \case - WriterPrimTell w -> lift (alg (WriterPrimTell w)) + WriterPrimTell o -> lift (alg (WriterPrimTell o)) WriterPrimListen m -> (`threadEff` (ListenPrimListen m)) $ \case - ListenPrimTell w -> alg (WriterPrimTell w) + ListenPrimTell o -> alg (WriterPrimTell o) ListenPrimListen m' -> alg (WriterPrimListen m') WriterPrimPass m -> h alg m {-# INLINE threadWriterPrim #-} -instance ( Reifies s (ReifiedEffAlgebra (WriterPrim w) m) - , Monoid w +instance ( Reifies s (ReifiedEffAlgebra (WriterPrim o) m) + , Monoid o , Monad m ) - => MonadWriter w (ViaAlg s (WriterPrim w) m) where - tell w = case reflect @s of - ReifiedEffAlgebra alg -> coerceAlg alg (WriterPrimTell w) + => MonadWriter o (ViaAlg s (WriterPrim o) m) where + tell o = case reflect @s of + ReifiedEffAlgebra alg -> coerceAlg alg (WriterPrimTell o) {-# INLINE tell #-} listen m = case reflect @s of @@ -100,29 +100,29 @@ {-# INLINE pass #-} -- | A valid definition of 'threadEff' for a --- @'Monoid' w => 'ThreadsEff' ('WriterPrim' w) t@ instance, +-- @'Monoid' o => 'ThreadsEff' ('WriterPrim' o) t@ instance, -- given that @t@ lifts @'MonadWriter' w@. -threadWriterPrimViaClass :: forall w t m a - . (Monoid w, MonadTrans t, Monad m) +threadWriterPrimViaClass :: forall o t m a + . (Monoid o, MonadTrans t, Monad m) => ( RepresentationalT t - , forall b. MonadWriter w b => MonadWriter w (t b) + , forall b. MonadWriter o b => MonadWriter o (t b) ) - => (forall x. WriterPrim w m x -> m x) - -> WriterPrim w (t m) a -> t m a + => (forall x. WriterPrim o m x -> m x) + -> WriterPrim o (t m) a -> t m a threadWriterPrimViaClass alg = \case - WriterPrimTell w -> lift (alg (WriterPrimTell w)) + WriterPrimTell o -> lift (alg (WriterPrimTell o)) WriterPrimListen m -> reify (ReifiedEffAlgebra alg) $ \(_ :: pr s) -> unViaAlgT $ fmap (\(f, a) -> (a, f)) $ listen - $ viaAlgT @s @(WriterPrim w) m + $ viaAlgT @s @(WriterPrim o) m WriterPrimPass m -> reify (ReifiedEffAlgebra alg) $ \(_ :: pr s) -> unViaAlgT $ pass $ fmap (\(f, a) -> (a, f)) - $ viaAlgT @s @(WriterPrim w) m + $ viaAlgT @s @(WriterPrim o) m {-# INLINE threadWriterPrimViaClass #-} #define THREAD_WRITERPRIM(monadT) \ @@ -136,7 +136,7 @@ THREAD_WRITERPRIM(LSt.StateT s) THREAD_WRITERPRIM(SSt.StateT s) -instance Monoid s => ThreadsEff (LWr.WriterT s) (WriterPrim w) where +instance Monoid s => ThreadsEff (LWr.WriterT s) (WriterPrim o) where threadEff = threadWriterPrim $ \alg m -> LWr.WriterT $ alg @@ -145,7 +145,7 @@ $ LWr.runWriterT m {-# INLINE threadEff #-} -instance Monoid s => ThreadsEff (SWr.WriterT s) (WriterPrim w) where +instance Monoid s => ThreadsEff (SWr.WriterT s) (WriterPrim o) where threadEff = threadWriterPrim $ \alg m -> SWr.WriterT $ alg @@ -154,7 +154,7 @@ $ SWr.runWriterT m {-# INLINE threadEff #-} -instance Monoid s => ThreadsEff (CPSWr.WriterT s) (WriterPrim w) where +instance Monoid s => ThreadsEff (CPSWr.WriterT s) (WriterPrim o) where threadEff = threadWriterPrim $ \alg m -> CPSWr.writerT $ alg @@ -166,11 +166,11 @@ -- | Rewrite an 'Algebra' where the topmost effect is 'ListenPrim' into -- an 'Algebra' where the topmost effect is 'WriterPrim' by providing -- an implementation of 'WriterPrimPass'. -algListenPrimIntoWriterPrim :: Algebra' (ListenPrim w ': p) m a - -> (m (w -> w, a) -> m a) - -> Algebra' (WriterPrim w ': p) m a +algListenPrimIntoWriterPrim :: Algebra' (ListenPrim o ': p) m a + -> (m (o -> o, a) -> m a) + -> Algebra' (WriterPrim o ': p) m a algListenPrimIntoWriterPrim alg h = powerAlg (weakenAlg alg) $ \case - WriterPrimTell w -> (alg . inj) (ListenPrimTell w) + WriterPrimTell o -> (alg . inj) (ListenPrimTell o) WriterPrimListen m -> (alg . inj) (ListenPrimListen m) WriterPrimPass m -> h m {-# INLINE algListenPrimIntoWriterPrim #-}
src/Control/Effect/Writer.hs view
@@ -25,16 +25,21 @@ , runTellIORef , runTellTVar - , tellIntoEndoTell+ , runTellAction + , tellIntoEndoTell , tellToTell , tellIntoTell + , ignoreTell+ -- * Simple variants of interpretations for 'Tell' , tellToIOSimple , runTellIORefSimple , runTellTVarSimple + , runTellActionSimple+ , tellToTellSimple , tellIntoTellSimple @@ -77,6 +82,7 @@ , TellListC , TellListLazyC , TellIntoEndoTellC+ , IgnoreTellC , ListenC , ListenLazyC , ListenTVarC@@ -118,51 +124,55 @@ import Control.Effect.Carrier.Internal.Intro import Control.Monad.Trans.Identity --- | A pseudo-effect for connected @'Tell' s@, @'Listen' s@ and @'Pass' s@ effects.+-- | A pseudo-effect for connected @'Tell' o@, @'Listen' o@ and @'Pass' o@ effects. -- -- @'Writer'@ should only ever be used inside of 'Eff' and 'Effs' -- constraints. It is not a real effect! See 'Bundle'.-type Writer s = Bundle '[Tell s, Listen s, Pass s]+type Writer o = Bundle '[Tell o, Listen o, Pass o] -tell :: Eff (Tell s) m => s -> m ()+tell :: Eff (Tell o) m => o -> m () tell = send . Tell {-# INLINE tell #-} -listen :: Eff (Listen s) m => m a -> m (s, a)+listen :: Eff (Listen o) m => m a -> m (o, a) listen = send . Listen {-# INLINE listen #-} -pass :: Eff (Pass s) m => m (s -> s, a) -> m a-pass = send . Pass+pass :: Eff (Pass o) m => m (o -> o, a) -> m a+pass = send .# Pass {-# INLINE pass #-} -censor :: Eff (Pass s) m => (s -> s) -> m a -> m a+censor :: Eff (Pass o) m => (o -> o) -> m a -> m a censor f = pass . fmap ((,) f) {-# INLINE censor #-} data TellListH -type TellListC s = CompositionC- '[ ReinterpretC TellListH (Tell s) '[Tell (Dual [s])]- , TellC (Dual [s])+type TellListC o = CompositionC+ '[ ReinterpretC TellListH (Tell o) '[Tell (Dual [o])]+ , TellC (Dual [o]) ] -instance Eff (Tell (Dual [s])) m- => Handler TellListH (Tell s) m where- effHandler (Tell s) = tell (Dual [s])+instance Eff (Tell (Dual [o])) m+ => Handler TellListH (Tell o) m where+ effHandler (Tell o) = tell (Dual [o]) {-# INLINEABLE effHandler #-} --- | Run a @'Tell' s@ by gathering the 'tell's into a list.+-- | Run a @'Tell' o@ effect by gathering the 'tell's into a list. --+-- @'Derivs' ('TellListC' o m) = 'Tell' o ': 'Derivs' m@+--+-- @'Prims' ('TellListC' o m) = 'Prims' m@+-- -- The resulting list is produced strictly. See 'runTellListLazy' for a lazy -- variant.-runTellList :: forall s m a p+runTellList :: forall o m a p . ( Carrier m , Threaders '[WriterThreads] m p )- => TellListC s m a- -> m ([s], a)+ => TellListC o m a+ -> m ([o], a) runTellList = (fmap . first) (reverse .# getDual) . runTell@@ -172,27 +182,31 @@ data TellListLazyH -type TellListLazyC s = CompositionC- '[ ReinterpretC TellListLazyH (Tell s) '[Tell (Endo [s])]- , TellLazyC (Endo [s])+type TellListLazyC o = CompositionC+ '[ ReinterpretC TellListLazyH (Tell o) '[Tell (Endo [o])]+ , TellLazyC (Endo [o]) ] -instance Eff (Tell (Endo [s])) m- => Handler TellListLazyH (Tell s) m where- effHandler (Tell s) = tell (Endo (s:))+instance Eff (Tell (Endo [o])) m+ => Handler TellListLazyH (Tell o) m where+ effHandler (Tell o) = tell (Endo (o:)) {-# INLINEABLE effHandler #-} --- | Run a @'Tell' s@ by gathering the 'tell's into a list.+-- | Run a @'Tell' o@ by gathering the 'tell's into a list. --+-- @'Derivs' ('TellListLazyC' o m) = 'Tell' o ': 'Derivs' m@+--+-- @'Prims' ('TellListLazyC' o m) = 'Prims' m@+-- -- This is a variant of 'runTellList' that produces the -- final list lazily. __Use this only if you need__ -- __the laziness, as this would otherwise incur an unneccesary space leak.__-runTellListLazy :: forall s m a p+runTellListLazy :: forall o m a p . ( Carrier m , Threaders '[WriterLazyThreads] m p )- => TellListLazyC s m a- -> m ([s], a)+ => TellListLazyC o m a+ -> m ([o], a) runTellListLazy = fromEndoWriter . runTellLazy@@ -201,7 +215,7 @@ {-# INLINE runTellListLazy #-} --- | Run a @'Tell' s@ effect, where @s@ is a 'Monoid', by accumulating+-- | Run a @'Tell' o@ effect, where @o@ is a 'Monoid', by accumulating -- all the uses of 'tell'. -- -- You may want to combine this with 'tellIntoTell'.@@ -211,25 +225,25 @@ -- impose any primitive effects, meaning 'runTell' doesn't restrict what -- interpreters are run before it. ----- @'Derivs' ('TellC' s m) = 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('TellC' o m) = 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('TellC' s m) = 'Prims' m@+-- @'Prims' ('TellC' o m) = 'Prims' m@ ----- This produces the final accumulation @s@ strictly. See 'runTellLazy' for a+-- This produces the final accumulation @o@ strictly. See 'runTellLazy' for a -- lazy variant of this.-runTell :: forall s m a p- . ( Monoid s+runTell :: forall o m a p+ . ( Monoid o , Carrier m , Threaders '[WriterThreads] m p )- => TellC s m a- -> m (s, a)+ => TellC o m a+ -> m (o, a) runTell (TellC m) = do- (a, s) <- W.runWriterT m- return (s, a)+ (a, o) <- W.runWriterT m+ return (o, a) {-# INLINE runTell #-} --- | Run connected @'Listen' s@ and @'Tell' s@ effects, where @s@ is a 'Monoid',+-- | Run connected @'Listen' o@ and @'Tell' o@ effects, where @o@ is a 'Monoid', -- by accumulating all the uses of 'tell'. -- -- Unlike 'runWriter', this does not provide the power of 'pass'; but because@@ -237,116 +251,116 @@ -- a larger variety of interpreters may be run before 'runListen' compared to -- 'runWriter'. ----- @'Derivs' ('ListenC' s m) = 'Listen' s ': 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('ListenC' o m) = 'Listen' o ': 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('ListenC' s m) = 'ListenPrim' s ': 'Prims' m@+-- @'Prims' ('ListenC' o m) = 'ListenPrim' o ': 'Prims' m@ -- -- This produces the final accumulation strictly. See 'runListenLazy' for a -- lazy variant of this.-runListen :: forall s m a p- . ( Monoid s+runListen :: forall o m a p+ . ( Monoid o , Carrier m , Threaders '[WriterThreads] m p )- => ListenC s m a- -> m (s, a)+ => ListenC o m a+ -> m (o, a) runListen (ListenC m) = do- (a, s) <- W.runWriterT m- return (s, a)+ (a, o) <- W.runWriterT m+ return (o, a) {-# INLINE runListen #-} --- | Run connected @'Pass' s@, @'Listen' s@ and @'Tell' s@ effects,--- -- i.e. @'Writer' s@ -- where @s@ is a 'Monoid', by accumulating all the+-- | Run connected @'Pass' o@, @'Listen' o@ and @'Tell' o@ effects,+-- -- i.e. @'Writer' o@ -- where @o@ is a 'Monoid', by accumulating all the -- uses of 'tell'. ----- @'Pass' s@ is a fairly restrictive primitive effect. Notably,+-- @'Pass' o@ is a fairly restrictive primitive effect. Notably, -- 'Control.Effect.Cont.runCont' can't be used before 'runWriter'. -- If you don't need 'pass', consider using 'runTell' or 'runListen' instead. ----- @'Derivs' ('WriterC' s m) = 'Pass' s ': 'Listen' s ': 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('WriterC' o m) = 'Pass' o ': 'Listen' o ': 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('WriterC' s m) = 'WriterPrim' s ': 'Prims' m@+-- @'Prims' ('WriterC' o m) = 'WriterPrim' o ': 'Prims' m@ -- -- This produces the final accumulation strictly. See 'runWriterLazy' for a -- lazy variant of this.-runWriter :: forall s m a p- . ( Monoid s+runWriter :: forall o m a p+ . ( Monoid o , Carrier m , Threaders '[WriterThreads] m p )- => WriterC s m a- -> m (s, a)+ => WriterC o m a+ -> m (o, a) runWriter (WriterC m) = do- (a, s) <- W.runWriterT m- return (s, a)+ (a, o) <- W.runWriterT m+ return (o, a) {-# INLINE runWriter #-} --- | Run a @'Tell' s@ effect, where @s@ is a 'Monoid', by accumulating all the+-- | Run a @'Tell' o@ effect, where @o@ is a 'Monoid', by accumulating all the -- uses of 'tell' lazily. ----- @'Derivs' ('TellLazyC' s m) = 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('TellLazyC' o m) = 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('TellLazyC' s m) = 'Prims' m@+-- @'Prims' ('TellLazyC' o m) = 'Prims' m@ -- -- This is a variant of 'runTell' that produces the final accumulation -- lazily. __Use this only if you need__ -- __the laziness, as this would otherwise incur an unneccesary space leak.__-runTellLazy :: forall s m a p- . ( Monoid s+runTellLazy :: forall o m a p+ . ( Monoid o , Carrier m , Threaders '[WriterLazyThreads] m p )- => TellLazyC s m a- -> m (s, a)+ => TellLazyC o m a+ -> m (o, a) runTellLazy (TellLazyC m) = swap <$> LW.runWriterT m {-# INLINE runTellLazy #-} --- | Run connected @'Listen' s@ and @'Tell' s@ effects,--- where @s@ is a 'Monoid', by accumulating all the uses of 'tell' lazily.+-- | Run connected @'Listen' o@ and @'Tell' o@ effects,+-- where @o@ is a 'Monoid', by accumulating all the uses of 'tell' lazily. ----- @'Derivs' ('ListenLazyC' s m) = 'Listen' s ': 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('ListenLazyC' o m) = 'Listen' o ': 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('ListenLazyC' s m) = 'ListenPrim' s ': 'Prims' m@+-- @'Prims' ('ListenLazyC' o m) = 'ListenPrim' o ': 'Prims' m@ -- -- This is a variant of 'runListen' that produces the -- final accumulation lazily. __Use this only if you need__ -- __the laziness, as this would otherwise incur an unneccesary space leak.__-runListenLazy :: forall s m a p- . ( Monoid s+runListenLazy :: forall o m a p+ . ( Monoid o , Carrier m , Threaders '[WriterThreads] m p )- => ListenLazyC s m a- -> m (s, a)+ => ListenLazyC o m a+ -> m (o, a) runListenLazy (ListenLazyC m) = swap <$> LW.runWriterT m {-# INLINE runListenLazy #-} --- | Run connected @'Pass' s@, @'Listen' s@ and @'Tell' s@ effects,--- -- i.e. @'Writer' s@ -- where @s@ is a 'Monoid',+-- | Run connected @'Pass' o@, @'Listen' o@ and @'Tell' o@ effects,+-- -- i.e. @'Writer' o@ -- where @o@ is a 'Monoid', -- by accumulating all the uses of 'tell' lazily. ----- @'Derivs' ('ListenLazyC' s m) = 'Pass' s ': 'Listen' s ': 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('ListenLazyC' o m) = 'Pass' o ': 'Listen' o ': 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('ListenLazyC' s m) = 'WriterPrim' s ': 'Prims' m@+-- @'Prims' ('ListenLazyC' o m) = 'WriterPrim' o ': 'Prims' m@ -- -- This is a variant of 'runListen' that produces the -- final accumulation lazily. __Use this only if you need__ -- __the laziness, as this would otherwise incur an unneccesary space leak.__-runWriterLazy :: forall s m a p- . ( Monoid s+runWriterLazy :: forall o m a p+ . ( Monoid o , Carrier m , Threaders '[WriterLazyThreads] m p )- => WriterLazyC s m a- -> m (s, a)+ => WriterLazyC o m a+ -> m (o, a) runWriterLazy (WriterLazyC m) = swap <$> LW.runWriterT m {-# INLINE runWriterLazy #-} -tellTVar :: ( Monoid s- , Effs '[Reader (s -> STM ()), Embed IO] m+tellTVar :: ( Monoid o+ , Effs '[Ask (o -> STM ()), Embed IO] m )- => s+ => o -> m () tellTVar o = do write <- ask@@ -356,19 +370,19 @@ data WriterToEndoWriterH -instance (Monoid s, Eff (Tell (Endo s)) m)- => Handler WriterToEndoWriterH (Tell s) m where- effHandler (Tell s) = tell (Endo (s <>))+instance (Monoid o, Eff (Tell (Endo o)) m)+ => Handler WriterToEndoWriterH (Tell o) m where+ effHandler (Tell o) = tell (Endo (o <>)) {-# INLINEABLE effHandler #-} -instance (Monoid s, Eff (Listen (Endo s)) m)- => Handler WriterToEndoWriterH (Listen s) m where+instance (Monoid o, Eff (Listen (Endo o)) m)+ => Handler WriterToEndoWriterH (Listen o) m where effHandler (Listen m) = (fmap . first) (\(Endo f) -> f mempty) $ listen m {-# INLINEABLE effHandler #-} -instance (Monoid s, Eff (Pass (Endo s)) m)- => Handler WriterToEndoWriterH (Pass s) m where+instance (Monoid o, Eff (Pass (Endo o)) m)+ => Handler WriterToEndoWriterH (Pass o) m where effHandler (Pass m) = pass $ (fmap . first)@@ -376,16 +390,16 @@ m {-# INLINEABLE effHandler #-} -fromEndoWriter :: (Monoid s, Functor f)- => f (Endo s, a)- -> f (s, a)+fromEndoWriter :: (Monoid o, Functor f)+ => f (Endo o, a)+ -> f (o, a) fromEndoWriter = (fmap . first) (\(Endo f) -> f mempty) {-# INLINE fromEndoWriter #-} -type TellIntoEndoTellC s =- ReinterpretC WriterToEndoWriterH (Tell s) '[Tell (Endo s)]+type TellIntoEndoTellC o =+ ReinterpretC WriterToEndoWriterH (Tell o) '[Tell (Endo o)] --- | Rewrite a @'Tell' s@ effect into a @'Tell' ('Endo' s)@ effect.+-- | Rewrite a @'Tell' o@ effect into a @'Tell' ('Endo' o)@ effect. -- -- This effectively right-associates all uses of 'tell', which -- asymptotically improves performance if the time complexity of '<>' for the@@ -404,22 +418,22 @@ -- $ 'tellIntoEndoTell' \@String -- The 'Monoid' must be specified -- $ ... -- @-tellIntoEndoTell :: ( Monoid s- , HeadEff (Tell (Endo s)) m+tellIntoEndoTell :: ( Monoid o+ , HeadEff (Tell (Endo o)) m )- => TellIntoEndoTellC s m a+ => TellIntoEndoTellC o m a -> m a tellIntoEndoTell = reinterpretViaHandler {-# INLINE tellIntoEndoTell #-} -type ListenIntoEndoListenC s = CompositionC- '[ IntroC '[Listen s, Tell s] '[Listen (Endo s), Tell (Endo s)]- , InterpretC WriterToEndoWriterH (Listen s)- , InterpretC WriterToEndoWriterH (Tell s)+type ListenIntoEndoListenC o = CompositionC+ '[ IntroC '[Listen o, Tell o] '[Listen (Endo o), Tell (Endo o)]+ , InterpretC WriterToEndoWriterH (Listen o)+ , InterpretC WriterToEndoWriterH (Tell o) ] --- | Rewrite connected @'Listen' s@ and @'Tell' s@ effects into--- connected @'Listen' ('Endo' s)@ and @'Tell' ('Endo' s)@ effects.+-- | Rewrite connected @'Listen' o@ and @'Tell' o@ effects into+-- connected @'Listen' ('Endo' o)@ and @'Tell' ('Endo' o)@ effects. -- -- This effectively right-associates all uses of 'tell', which -- asymptotically improves performance if the time complexity of '<>' for the@@ -439,10 +453,10 @@ -- $ ... -- @ ---listenIntoEndoListen :: ( Monoid s- , HeadEffs '[Listen (Endo s), Tell (Endo s)] m+listenIntoEndoListen :: ( Monoid o+ , HeadEffs '[Listen (Endo o), Tell (Endo o)] m )- => ListenIntoEndoListenC s m a+ => ListenIntoEndoListenC o m a -> m a listenIntoEndoListen = interpretViaHandler@@ -451,18 +465,18 @@ .# runComposition {-# INLINE listenIntoEndoListen #-} -type WriterIntoEndoWriterC s = CompositionC- '[ IntroC '[Pass s, Listen s, Tell s]- '[Pass (Endo s), Listen (Endo s), Tell (Endo s)]- , InterpretC WriterToEndoWriterH (Pass s)- , InterpretC WriterToEndoWriterH (Listen s)- , InterpretC WriterToEndoWriterH (Tell s)+type WriterIntoEndoWriterC o = CompositionC+ '[ IntroC '[Pass o, Listen o, Tell o]+ '[Pass (Endo o), Listen (Endo o), Tell (Endo o)]+ , InterpretC WriterToEndoWriterH (Pass o)+ , InterpretC WriterToEndoWriterH (Listen o)+ , InterpretC WriterToEndoWriterH (Tell o) ] --- | Rewrite connected @'Pass' s@, @'Listen' s@ and @'Tell' s@ effects--- -- i.e. @'Writer' s@ -- into connected @'Pass' ('Endo' s)@,--- @'Listen' ('Endo' s)@ and @'Tell' (Endo s)@ effects on top of the effect--- stack -- i.e. @'Writer' (Endo s)@.+-- | Rewrite connected @'Pass' o@, @'Listen' o@ and @'Tell' o@ effects+-- -- i.e. @'Writer' o@ -- into connected @'Pass' ('Endo' o)@,+-- @'Listen' ('Endo' o)@ and @'Tell' ('Endo' o)@ effects on top of the effect+-- stack -- i.e. @'Writer' ('Endo' o)@. -- -- This effectively right-associates all uses of 'tell', which -- asymptotically improves performance if the time complexity of '<>' for the@@ -481,12 +495,12 @@ -- $ 'writerIntoEndoWriter' \@String -- The 'Monoid' must be specified -- $ ... -- @-writerIntoEndoWriter :: ( Monoid s+writerIntoEndoWriter :: ( Monoid o , HeadEffs- '[Pass (Endo s), Listen (Endo s), Tell (Endo s)]+ '[Pass (Endo o), Listen (Endo o), Tell (Endo o)] m )- => WriterIntoEndoWriterC s m a+ => WriterIntoEndoWriterC o m a -> m a writerIntoEndoWriter = interpretViaHandler@@ -499,8 +513,8 @@ -- | Transform a 'Tell' effect into another 'Tell' effect by providing a function -- to transform the type told. ----- This is useful to transform a @'Tell' s@ effect where @s@ isn't a 'Monoid'--- into a @'Tell' t@ effect where @@ _is_ a 'Monoid', and thus can be+-- This is useful to transform a @'Tell' o@ effect where @o@ isn't a 'Monoid'+-- into a @'Tell' o'@ effect where @o'@ /is/ a 'Monoid', and thus can be -- interpreted using the various 'Monoid'al 'Tell' interpreters. -- -- This has a higher-rank type, as it makes use of 'InterpretReifiedC'.@@ -509,40 +523,40 @@ -- -- If performance is secondary, consider using the slower -- 'tellToTellSimple', which doesn't have a higher-rank type.-tellToTell :: forall s t m a- . Eff (Tell t) m- => (s -> t)- -> InterpretReifiedC (Tell s) m a+tellToTell :: forall o o' m a+ . Eff (Tell o') m+ => (o -> o')+ -> InterpretReifiedC (Tell o) m a -> m a tellToTell f = interpret $ \case- Tell s -> tell (f s)+ Tell o -> tell (f o) {-# INLINE tellToTell #-} -- | Transform a 'Tell' effect into another 'Tell' effect by providing a function -- to transform the type told. ----- This is useful to transform a @'Tell' s@ where @s@ isn't a 'Monoid' into a--- @'Tell' t@ effect where @@ _is_ a 'Monoid', and thus can be interpreted using+-- This is useful to transform a @'Tell' o@ where @o@ isn't a 'Monoid' into a+-- @'Tell' p@ effect where @p@ /is/ a 'Monoid', and thus can be interpreted using -- the various 'Monoid'al 'Tell' interpreters. -- -- This is a less performant version of 'tellToTell' that doesn't have -- a higher-rank type, making it much easier to use partially applied.-tellToTellSimple :: forall s t m a p- . ( Eff (Tell t) m+tellToTellSimple :: forall o o' m a p+ . ( Eff (Tell o') m , Threaders '[ReaderThreads] m p )- => (s -> t)- -> InterpretSimpleC (Tell s) m a+ => (o -> o')+ -> InterpretSimpleC (Tell o) m a -> m a tellToTellSimple f = interpretSimple $ \case- Tell s -> tell (f s)+ Tell o -> tell (f o) {-# INLINE tellToTellSimple #-} -- | Rewrite a 'Tell' effect into another 'Tell' effect on top of the effect -- stack by providing a function to transform the type told. ----- This is useful to rewrite a @'Tell' s@ effect where @s@ isn't a 'Monoid'--- into a @'Tell' t@ effect where @t@ _is_ a 'Monoid', and thus can be+-- This is useful to rewrite a @'Tell' o@ effect where @o@ isn't a 'Monoid'+-- into a @'Tell' t@ effect where @t@ /is/ a 'Monoid', and thus can be -- interpreted using the various 'Monoid'al 'Tell' interpreters. -- -- This has a higher-rank type, as it makes use of 'InterpretReifiedC'.@@ -551,56 +565,49 @@ -- -- If performance is secondary, consider using the slower -- 'tellIntoTellSimple', which doesn't have a higher-rank type.-tellIntoTell :: forall s t m a- . HeadEff (Tell t) m- => (s -> t)- -> ReinterpretReifiedC (Tell s) '[Tell t] m a+tellIntoTell :: forall o o' m a+ . HeadEff (Tell o') m+ => (o -> o')+ -> ReinterpretReifiedC (Tell o) '[Tell o'] m a -> m a tellIntoTell f = reinterpret $ \case- Tell s -> tell (f s)+ Tell o -> tell (f o) {-# INLINE tellIntoTell #-} -- | Rewrite a 'Tell' effect into another 'Tell' effect on top of the effect -- stack by providing a function to transform the type told. ----- This is useful to rewrite a @'Tell' s@ effect where @s@ isn't a 'Monoid'--- into a @'Tell' t@ effect where @@ _is_ a 'Monoid', and thus can be+-- This is useful to rewrite a @'Tell' o@ effect where @o@ isn't a 'Monoid'+-- into a @'Tell' o'@ effect where @o'@ /is/ a 'Monoid', and thus can be -- interpreted using the various 'Monoid'al 'Tell' interpreters. ----- This has a higher-rank type, as it makes use of 'InterpretReifiedC'.--- __This makes 'tellToTell' very difficult to use partially applied.__--- __In particular, it can't be composed using @'.'@.__------ If performance is secondary, consider using the slower--- 'tellIntoTellSimple', which doesn't have a higher-rank type.--- -- This is a less performant version of 'tellIntoTell' that doesn't have -- a higher-rank type, making it much easier to use partially applied.-tellIntoTellSimple :: forall s t m a p- . ( HeadEff (Tell t) m+tellIntoTellSimple :: forall o o' m a p+ . ( HeadEff (Tell o') m , Threaders '[ReaderThreads] m p )- => (s -> t)- -> ReinterpretSimpleC (Tell s) '[Tell t] m a+ => (o -> o')+ -> ReinterpretSimpleC (Tell o) '[Tell o'] m a -> m a tellIntoTellSimple f = reinterpretSimple $ \case- Tell s -> tell (f s)+ Tell o -> tell (f o) {-# INLINE tellIntoTellSimple #-} -listenTVar :: forall s m a- . ( Monoid s- , Effs '[Reader (s -> STM ()), Embed IO, Bracket] m+listenTVar :: forall o m a+ . ( Monoid o+ , Effs '[Reader (o -> STM ()), Embed IO, Bracket] m ) => m a- -> m (s, a)+ -> m (o, a) listenTVar main = do writeGlobal <- ask localVar <- embed $ newTVarIO mempty switch <- embed $ newTVarIO True let- writeLocal :: s -> STM ()+ writeLocal :: o -> STM () writeLocal o = do writeToLocal <- readTVar switch when writeToLocal $ do@@ -610,21 +617,21 @@ a <- (local (\_ -> writeLocal) main) `finally` (embed $ atomically $ writeTVar switch False)- s <- embed $ readTVarIO localVar- return (s, a)+ o <- embed $ readTVarIO localVar+ return (o, a) -passTVar :: forall s m a- . ( Monoid s- , Effs '[Reader (s -> STM ()), Embed IO, Bracket] m+passTVar :: forall o m a+ . ( Monoid o+ , Effs '[Reader (o -> STM ()), Embed IO, Bracket] m )- => m (s -> s, a)+ => m (o -> o, a) -> m a passTVar main = do writeGlobal <- ask localVar <- embed $ newTVarIO mempty switch <- embed $ newTVarIO True let- writeLocal :: s -> STM ()+ writeLocal :: o -> STM () writeLocal o = do writeToLocal <- readTVar switch if writeToLocal then do@@ -633,12 +640,12 @@ else writeGlobal o - commit :: (s -> s) -> IO ()+ commit :: (o -> o) -> IO () commit f = atomically $ do notAlreadyCommited <- readTVar switch when notAlreadyCommited $ do- s <- readTVar localVar- writeGlobal (f s)+ o <- readTVar localVar+ writeGlobal (f o) writeTVar switch False ((_, a), _) <-@@ -653,69 +660,69 @@ data WriterToBracketH -type WriterToBracketC s = CompositionC- '[ IntroC '[Pass s, Listen s, Tell s] '[Local (s -> STM ()), Ask (s -> STM ())]- , InterpretC WriterToBracketH (Pass s)- , InterpretC WriterToBracketH (Listen s)- , InterpretC WriterTVarH (Tell s)- , ReaderC (s -> STM ())+type WriterToBracketC o = CompositionC+ '[ IntroC '[Pass o, Listen o, Tell o] '[Local (o -> STM ()), Ask (o -> STM ())]+ , InterpretC WriterToBracketH (Pass o)+ , InterpretC WriterToBracketH (Listen o)+ , InterpretC WriterTVarH (Tell o)+ , ReaderC (o -> STM ()) ] -instance ( Monoid s- , Effs '[Reader (s -> STM ()), Embed IO, Bracket] m+instance ( Monoid o+ , Effs '[Reader (o -> STM ()), Embed IO, Bracket] m )- => Handler WriterToBracketH (Listen s) m where+ => Handler WriterToBracketH (Listen o) m where effHandler (Listen m) = listenTVar m {-# INLINEABLE effHandler #-} -instance ( Monoid s- , Effs '[Reader (s -> STM ()), Embed IO, Bracket] m+instance ( Monoid o+ , Effs '[Reader (o -> STM ()), Embed IO, Bracket] m )- => Handler WriterToBracketH (Pass s) m where+ => Handler WriterToBracketH (Pass o) m where effHandler (Pass m) = passTVar m {-# INLINEABLE effHandler #-} --- | Run connected @'Pass' s@, @'Listen' s@ and @'Tell' s@ effects--- -- i.e. @'Writer' s@ -- by accumulating uses of 'tell' through using atomic+-- | Run connected @'Pass' o@, @'Listen' o@ and @'Tell' o@ effects+-- -- i.e. @'Writer' o@ -- by accumulating uses of 'tell' through using atomic -- operations in 'IO', relying on the provided protection of 'Bracket' for -- the implementation. ----- @'Derivs' ('WriterToBracketC' s m) = 'Pass' s ': 'Listen' s : 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('WriterToBracketC' o m) = 'Pass' o ': 'Listen' o : 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('WriterToBracketC' s m) = 'Control.Effect.Type.ReaderPrim.ReaderPrim' (s -> STM ()) ': 'Prims' m@+-- @'Prims' ('WriterToBracketC' o m) = 'Control.Effect.Type.ReaderPrim.ReaderPrim' (o -> STM ()) ': 'Prims' m@ ----- Note that unlike 'writerToIO', this does not have a higher-rank type.-writerToBracket :: forall s m a p- . ( Monoid s+-- Note that unlike 'tellToIO', this does not have a higher-rank type.+writerToBracket :: forall o m a p+ . ( Monoid o , Effs [Embed IO, Bracket] m , Threaders '[ReaderThreads] m p )- => WriterToBracketC s m a- -> m (s, a)+ => WriterToBracketC o m a+ -> m (o, a) writerToBracket m = do tvar <- embed $ newTVarIO mempty a <- writerToBracketTVar tvar m- s <- embed $ readTVarIO tvar- return (s, a)+ o <- embed $ readTVarIO tvar+ return (o, a) {-# INLINE writerToBracket #-} --- | Run connected @'Pass' s@, @'Listen' s@ and @'Tell' s@ effects--- -- i.e. @'Writer' s@ -- by accumulating uses of 'tell' through using atomic+-- | Run connected @'Pass' o@, @'Listen' o@ and @'Tell' o@ effects+-- -- i.e. @'Writer' o@ -- by accumulating uses of 'tell' through using atomic -- operations in 'IO' over a 'TVar', relying on the provided protection -- of 'Bracket' for the implementation. ----- @'Derivs' ('WriterToBracketC' s m) = 'Pass' s ': 'Listen' s : 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('WriterToBracketC' o m) = 'Pass' o ': 'Listen' o : 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('WriterToBracketC' s m) = 'Control.Effect.Type.ReaderPrim.ReaderPrim' (s -> STM ()) ': 'Prims' m@+-- @'Prims' ('WriterToBracketC' o m) = 'Control.Effect.Type.ReaderPrim.ReaderPrim' (o -> STM ()) ': 'Prims' m@ -- -- Note that unlike 'runTellTVar', this does not have a higher-rank type.-writerToBracketTVar :: forall s m a p- . ( Monoid s+writerToBracketTVar :: forall o m a p+ . ( Monoid o , Effs [Embed IO, Bracket] m , Threaders '[ReaderThreads] m p )- => TVar s- -> WriterToBracketC s m a+ => TVar o+ -> WriterToBracketC o m a -> m a writerToBracketTVar tvar = runReader (\o -> do@@ -731,79 +738,79 @@ data WriterTVarH -type ListenTVarC s = CompositionC- '[ IntroC '[Listen s, Tell s]- '[ ListenPrim s- , Local (s -> STM ())- , Ask (s -> STM ())+type ListenTVarC o = CompositionC+ '[ IntroC '[Listen o, Tell o]+ '[ ListenPrim o+ , Local (o -> STM ())+ , Ask (o -> STM ()) ]- , InterpretC WriterTVarH (Listen s)- , InterpretC WriterTVarH (Tell s)- , InterpretPrimC WriterTVarH (ListenPrim s)- , ReaderC (s -> STM ())+ , InterpretC WriterTVarH (Listen o)+ , InterpretC WriterTVarH (Tell o)+ , InterpretPrimC WriterTVarH (ListenPrim o)+ , ReaderC (o -> STM ()) ] -type WriterTVarC s = CompositionC- '[ IntroC '[Pass s, Listen s, Tell s]- '[ ListenPrim s- , WriterPrim s- , Local (s -> STM ())- , Ask (s -> STM ())+type WriterTVarC o = CompositionC+ '[ IntroC '[Pass o, Listen o, Tell o]+ '[ ListenPrim o+ , WriterPrim o+ , Local (o -> STM ())+ , Ask (o -> STM ()) ]- , InterpretC WriterTVarH (Pass s)- , InterpretC WriterTVarH (Listen s)- , InterpretC WriterTVarH (Tell s)- , InterpretC WriterTVarH (ListenPrim s)- , InterpretPrimC WriterTVarH (WriterPrim s)- , ReaderC (s -> STM ())+ , InterpretC WriterTVarH (Pass o)+ , InterpretC WriterTVarH (Listen o)+ , InterpretC WriterTVarH (Tell o)+ , InterpretC WriterTVarH (ListenPrim o)+ , InterpretPrimC WriterTVarH (WriterPrim o)+ , ReaderC (o -> STM ()) ] -instance ( Monoid s- , Effs '[Reader (s -> STM ()), Embed IO] m+instance ( Monoid o+ , Effs '[Reader (o -> STM ()), Embed IO] m )- => Handler WriterTVarH (Tell s) m where+ => Handler WriterTVarH (Tell o) m where effHandler (Tell o) = tellTVar o {-# INLINEABLE effHandler #-} -instance Eff (ListenPrim s) m- => Handler WriterTVarH (Listen s) m where+instance Eff (ListenPrim o) m+ => Handler WriterTVarH (Listen o) m where effHandler (Listen m) = send $ ListenPrimListen m {-# INLINEABLE effHandler #-} -instance Eff (WriterPrim s) m- => Handler WriterTVarH (Pass s) m where+instance Eff (WriterPrim o) m+ => Handler WriterTVarH (Pass o) m where effHandler (Pass m) = send $ WriterPrimPass m {-# INLINEABLE effHandler #-} -instance Eff (WriterPrim s) m- => Handler WriterTVarH (ListenPrim s) m where+instance Eff (WriterPrim o) m+ => Handler WriterTVarH (ListenPrim o) m where effHandler = \case ListenPrimTell o -> send $ WriterPrimTell o ListenPrimListen m -> send $ WriterPrimListen m {-# INLINEABLE effHandler #-} -instance ( Monoid s- , Effs '[Reader (s -> STM ()), Embed IO] m+instance ( Monoid o+ , Effs '[Reader (o -> STM ()), Embed IO] m , C.MonadMask m )- => PrimHandler WriterTVarH (ListenPrim s) m where+ => PrimHandler WriterTVarH (ListenPrim o) m where effPrimHandler = \case- ListenPrimTell o -> tellTVar o+ ListenPrimTell o -> tellTVar o ListenPrimListen m -> bracketToIO (listenTVar (lift m)) {-# INLINEABLE effPrimHandler #-} -instance ( Monoid s- , Effs '[Reader (s -> STM ()), Embed IO] m+instance ( Monoid o+ , Effs '[Reader (o -> STM ()), Embed IO] m , C.MonadMask m )- => PrimHandler WriterTVarH (WriterPrim s) m where+ => PrimHandler WriterTVarH (WriterPrim o) m where effPrimHandler = \case- WriterPrimTell o -> tellTVar o+ WriterPrimTell o -> tellTVar o WriterPrimListen m -> bracketToIO (listenTVar (lift m))- WriterPrimPass m -> bracketToIO (passTVar (lift m))+ WriterPrimPass m -> bracketToIO (passTVar (lift m)) {-# INLINEABLE effPrimHandler #-} --- | Run a @'Tell' s@ effect where @s@ is a 'Monoid' by accumulating uses of+-- | Run a @'Tell' o@ effect where @o@ is a 'Monoid' by accumulating uses of -- 'tell' through atomic operations in 'IO'. -- -- You may want to combine this with 'tellIntoTell'.@@ -814,20 +821,20 @@ -- -- If performance is secondary, consider using the slower -- 'tellToIOSimple', which doesn't have a higher-rank type.-tellToIO :: forall s m a- . ( Monoid s+tellToIO :: forall o m a+ . ( Monoid o , Eff (Embed IO) m )- => InterpretReifiedC (Tell s) m a- -> m (s, a)+ => InterpretReifiedC (Tell o) m a+ -> m (o, a) tellToIO m = do ref <- embed $ newIORef mempty a <- runTellIORef ref m- s <- embed $ readIORef ref- return (s, a)+ o <- embed $ readIORef ref+ return (o, a) {-# INLINE tellToIO #-} --- | Run a @'Tell' s@ effect where @s@ is a 'Monoid' by accumulating uses of+-- | Run a @'Tell' o@ effect where @o@ is a 'Monoid' by accumulating uses of -- 'tell' through using atomic operations in 'IO' over the provided 'IORef'. -- -- This has a higher-rank type, as it makes use of 'InterpretReifiedC'.@@ -836,18 +843,18 @@ -- -- If performance is secondary, consider using the slower -- 'runTellIORefSimple', which doesn't have a higher-rank type.-runTellIORef :: forall s m a- . ( Monoid s+runTellIORef :: forall o m a+ . ( Monoid o , Eff (Embed IO) m )- => IORef s- -> InterpretReifiedC (Tell s) m a+ => IORef o+ -> InterpretReifiedC (Tell o) m a -> m a runTellIORef ref = interpret $ \case Tell o -> embed $ atomicModifyIORef' ref (\s -> (s <> o, ())) {-# INLINE runTellIORef #-} --- | Run a @'Tell' s@ effect where @s@ is a 'Monoid' by accumulating uses of+-- | Run a @'Tell' o@ effect where @o@ is a 'Monoid' by accumulating uses of -- 'tell' through using atomic operations in 'IO' over the provided 'TVar'. -- -- This has a higher-rank type, as it makes use of 'InterpretReifiedC'.@@ -856,12 +863,12 @@ -- -- If performance is secondary, consider using the slower -- 'runTellTVarSimple', which doesn't have a higher-rank type.-runTellTVar :: forall s m a- . ( Monoid s+runTellTVar :: forall o m a+ . ( Monoid o , Eff (Embed IO) m )- => TVar s- -> InterpretReifiedC (Tell s) m a+ => TVar o+ -> InterpretReifiedC (Tell o) m a -> m a runTellTVar tvar = interpret $ \case Tell o -> embed $ atomically $ do@@ -869,56 +876,56 @@ writeTVar tvar $! s <> o {-# INLINE runTellTVar #-} --- | Run a @'Tell' s@ effect where @s@ is a 'Monoid' by accumulating uses of+-- | Run a @'Tell' o@ effect where @o@ is a 'Monoid' by accumulating uses of -- 'tell' through atomic operations in 'IO'. -- -- You may want to combine this with 'tellIntoTellSimple'. -- -- This is a less performant version of 'tellToIO' that doesn't have -- a higher-rank type, making it much easier to use partially applied.-tellToIOSimple :: forall s m a p- . ( Monoid s+tellToIOSimple :: forall o m a p+ . ( Monoid o , Eff (Embed IO) m , Threaders '[ReaderThreads] m p )- => InterpretSimpleC (Tell s) m a- -> m (s, a)+ => InterpretSimpleC (Tell o) m a+ -> m (o, a) tellToIOSimple m = do ref <- embed $ newIORef mempty a <- runTellIORefSimple ref m- s <- embed $ readIORef ref- return (s, a)+ o <- embed $ readIORef ref+ return (o, a) {-# INLINE tellToIOSimple #-} --- | Run a @'Tell' s@ effect where @s@ is a 'Monoid' by accumulating uses of+-- | Run a @'Tell' o@ effect where @o@ is a 'Monoid' by accumulating uses of -- 'tell' through using atomic operations in 'IO' over the provided 'IORef'. -- -- This is a less performant version of 'tellToIO' that doesn't have -- a higher-rank type, making it much easier to use partially applied.-runTellIORefSimple :: forall s m a p- . ( Monoid s+runTellIORefSimple :: forall o m a p+ . ( Monoid o , Eff (Embed IO) m , Threaders '[ReaderThreads] m p )- => IORef s- -> InterpretSimpleC (Tell s) m a+ => IORef o+ -> InterpretSimpleC (Tell o) m a -> m a runTellIORefSimple ref = interpretSimple $ \case Tell o -> embed $ atomicModifyIORef' ref (\s -> (s <> o, ())) {-# INLINE runTellIORefSimple #-} --- | Run a @'Tell' s@ effect where @s@ is a 'Monoid' by accumulating uses of+-- | Run a @'Tell' o@ effect where @o@ is a 'Monoid' by accumulating uses of -- 'tell' through using atomic operations in 'IO' over the provided 'TVar'. -- -- This is a less performant version of 'tellToIO' that doesn't have -- a higher-rank type, making it much easier to use partially applied.-runTellTVarSimple :: forall s m a p- . ( Monoid s+runTellTVarSimple :: forall o m a p+ . ( Monoid o , Eff (Embed IO) m , Threaders '[ReaderThreads] m p )- => TVar s- -> InterpretSimpleC (Tell s) m a+ => TVar o+ -> InterpretSimpleC (Tell o) m a -> m a runTellTVarSimple tvar = interpretSimple $ \case Tell o -> embed $ atomically $ do@@ -926,45 +933,45 @@ writeTVar tvar $! s <> o {-# INLINE runTellTVarSimple #-} --- | Run connected @'Listen' s@ and @'Tell' s@ effects by accumulating uses of+-- | Run connected @'Listen' o@ and @'Tell' o@ effects by accumulating uses of -- 'tell' through using atomic operations in 'IO'. ----- @'Derivs' ('ListenTVarC' s m) = 'Listen' s ': 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('ListenTVarC' o m) = 'Listen' o ': 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('ListenTVarC' s m) = 'ListenPrim' s ': 'Control.Effect.Type.ReaderPrim.ReaderPrim' (s -> STM ()) ': 'Prims' m@+-- @'Prims' ('ListenTVarC' o m) = 'ListenPrim' o ': 'Control.Effect.Type.ReaderPrim.ReaderPrim' (o -> STM ()) ': 'Prims' m@ -- -- Note that unlike 'tellToIO', this does not have a higher-rank type.-listenToIO :: forall s m a p- . ( Monoid s+listenToIO :: forall o m a p+ . ( Monoid o , Eff (Embed IO) m , C.MonadMask m , Threaders '[ReaderThreads] m p )- => ListenTVarC s m a- -> m (s, a)+ => ListenTVarC o m a+ -> m (o, a) listenToIO m = do tvar <- embed $ newTVarIO mempty a <- runListenTVar tvar m- s <- embed $ readTVarIO tvar- return (s, a)+ o <- embed $ readTVarIO tvar+ return (o, a) {-# INLINE listenToIO #-} --- | Run connected @'Listen' s@ and @'Tell' s@ effects by accumulating uses of+-- | Run connected @'Listen' o@ and @'Tell' o@ effects by accumulating uses of -- 'tell' through using atomic operations in 'IO' over the provided 'TVar'. ----- @'Derivs' ('ListenTVarC' s m) = 'Listen' s : 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('ListenTVarC' o m) = 'Listen' o : 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('ListenTVarC' s m) = 'ListenPrim' s ': 'Control.Effect.Type.ReaderPrim.ReaderPrim' (s -> STM ()) ': 'Prims' m@+-- @'Prims' ('ListenTVarC' o m) = 'ListenPrim' o ': 'Control.Effect.Type.ReaderPrim.ReaderPrim' (o -> STM ()) ': 'Prims' m@ -- -- Note that unlike 'runTellTVar', this does not have a higher-rank type.-runListenTVar :: forall s m a p- . ( Monoid s+runListenTVar :: forall o m a p+ . ( Monoid o , Eff (Embed IO) m , C.MonadMask m , Threaders '[ReaderThreads] m p )- => TVar s- -> ListenTVarC s m a+ => TVar o+ -> ListenTVarC o m a -> m a runListenTVar tvar = runReader (\o -> do@@ -978,47 +985,47 @@ .# runComposition {-# INLINE runListenTVar #-} --- | Run connected @'Pass' s@, @'Listen' s@ and @'Tell' s@ effects--- -- i.e. @'Writer' s@ -- by accumulating uses of 'tell' through using atomic+-- | Run connected @'Pass' o@, @'Listen' o@ and @'Tell' o@ effects+-- -- i.e. @'Writer' o@ -- by accumulating uses of 'tell' through using atomic -- operations in 'IO'. ----- @'Derivs' ('WriterTVarC' s m) = 'Pass' s ': 'Listen' s : 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('WriterTVarC' o m) = 'Pass' o ': 'Listen' o : 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('WriterTVarC' s m) = 'WriterPrim' s ': 'Control.Effect.Type.ReaderPrim.ReaderPrim' (s -> STM ()) ': 'Prims' m@+-- @'Prims' ('WriterTVarC' o m) = 'WriterPrim' o ': 'Control.Effect.Type.ReaderPrim.ReaderPrim' (o -> STM ()) ': 'Prims' m@ -- -- Note that unlike 'tellToIO', this does not have a higher-rank type.-writerToIO :: forall s m a p- . ( Monoid s+writerToIO :: forall o m a p+ . ( Monoid o , Eff (Embed IO) m , C.MonadMask m , Threaders '[ReaderThreads] m p )- => WriterTVarC s m a- -> m (s, a)+ => WriterTVarC o m a+ -> m (o, a) writerToIO m = do tvar <- embed $ newTVarIO mempty a <- runWriterTVar tvar m- s <- embed $ readTVarIO tvar- return (s, a)+ o <- embed $ readTVarIO tvar+ return (o, a) {-# INLINE writerToIO #-} --- | Run connected @'Pass' s@, @'Listen' s@ and @'Tell' s@ effects--- -- i.e. @'Writer' s@ -- by accumulating uses of 'tell' through using atomic+-- | Run connected @'Pass' o@, @'Listen' o@ and @'Tell' o@ effects+-- -- i.e. @'Writer' o@ -- by accumulating uses of 'tell' through using atomic -- operations in 'IO' over a 'TVar'. ----- @'Derivs' ('WriterTVarC' s m) = 'Pass' s ': 'Listen' s : 'Tell' s ': 'Derivs' m@+-- @'Derivs' ('WriterTVarC' o m) = 'Pass' o ': 'Listen' o : 'Tell' o ': 'Derivs' m@ ----- @'Prims' ('WriterTVarC' s m) = 'WriterPrim' s ': 'Control.Effect.Type.ReaderPrim.ReaderPrim' (s -> STM ()) ': 'Prims' m@+-- @'Prims' ('WriterTVarC' o m) = 'WriterPrim' o ': 'Control.Effect.Type.ReaderPrim.ReaderPrim' (o -> STM ()) ': 'Prims' m@ -- -- Note that unlike 'runTellTVar', this does not have a higher-rank type.-runWriterTVar :: forall s m a p- . ( Monoid s+runWriterTVar :: forall o m a p+ . ( Monoid o , Eff (Embed IO) m , C.MonadMask m , Threaders '[ReaderThreads] m p )- => TVar s- -> WriterTVarC s m a+ => TVar o+ -> WriterTVarC o m a -> m a runWriterTVar tvar = runReader (\o -> do@@ -1033,3 +1040,52 @@ .# introUnderMany .# runComposition {-# INLINE runWriterTVar #-}+++-- | Run a 'Tell' effect by providing an action to be executed+-- at each use of 'tell'.+--+-- This has a higher-rank type, as it makes use of 'InterpretReifiedC'.+-- __This makes 'runTellAction' very difficult to use partially applied.__+-- __In particular, it can't be composed using @'.'@.__+--+-- If performance is secondary, consider using the slower 'runTellActionSimple',+-- which doesn't have a higher-rank type.+runTellAction :: forall o m a+ . Carrier m+ => (o -> m ())+ -> InterpretReifiedC (Tell o) m a+ -> m a+runTellAction act = interpret $ \case+ Tell o -> liftBase (act o)+{-# INLINE runTellAction #-}++-- | Run a 'Tell' effect by providing an action to be executed+-- at each use of 'tell'.+--+-- This is a less performant version of 'runTellAction' that doesn't have+-- a higher-rank type, making it much easier to use partially applied.+runTellActionSimple :: forall o m a p+ . (Carrier m, Threaders '[ReaderThreads] m p)+ => (o -> m ())+ -> InterpretSimpleC (Tell o) m a+ -> m a+runTellActionSimple act = interpretSimple $ \case+ Tell o -> liftBase (act o)+{-# INLINE runTellActionSimple #-}++data IgnoreTellH++instance Carrier m+ => Handler IgnoreTellH (Tell o) m where+ effHandler (Tell _) = pure ()+ {-# INLINEABLE effHandler #-}++type IgnoreTellC o = InterpretC IgnoreTellH (Tell o)++-- | Run a 'Tell' effect by ignoring it, doing no output at all.+ignoreTell :: forall o m a+ . Carrier m+ => IgnoreTellC o m a -> m a+ignoreTell = interpretViaHandler+{-# INLINE ignoreTell #-}
+ test/ContSpec.hs view
@@ -0,0 +1,51 @@+module ContSpec where + +import Control.Effect +import Control.Effect.Cont +import Control.Effect.Reader + +import Test.Hspec + +test :: Effs '[Shift (Int, Int), Reader Int] m => m (Int, Int) +test = do + i <- local @Int (*2) $ + shift @(Int, Int) $ \c -> + local @Int (*3) (ask @Int) + >>= local @Int (*5) . c + j <- local @Int (*7) $ ask @Int + return (i, j) + +test1 :: Effs '[Shift (Int, Int), Reader Int] m => m (Int, Int) +test1 = do + i <- shift @(Int, Int) $ \c -> + local @Int (*3) (ask @Int) + >>= local @Int (*5) . c + j <- local @Int (*7) $ ask @Int + return (i, j) + +spec :: Spec +spec = do + describe "runShift" $ do + it "neither local nor global HO-actions should affect a continuation,\ + \ whether applied inside or outside a 'shift'" $ do + let (i, j) = run $ runReader @Int 1 $ runShift $ test + i `shouldBe` 6 -- 2 * 3 + j `shouldBe` 7 + let (i', j') = run $ runShift $ runReader @Int 1 $ test + i' `shouldBe` 6 + j' `shouldBe` 7 + + + describe "runShiftFast" $ do + it "should have horrible semantics when threading ReaderPrim. \ + \See Issue #6." $ do + let (i, j) = run $ runReader @Int 1 $ runShiftFast $ test + i `shouldBe` 6 + j `shouldNotBe` 35 -- This is what we actually want it to be + j `shouldBe` 7 + let (i', j') = run $ runReader @Int 1 $ runShiftFast $ test1 + i' `shouldBe` 3 + j' `shouldBe` 35 + let (i'', j'') = run $ runShiftFast $ runReader @Int 1 $ test + i'' `shouldBe` 6 + j'' `shouldBe` 7