-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An Effect System based on Type Classes -- -- Please see the README on GitHub at -- https://github.com/typedbyte/effet#readme @package effet @version 0.3.0.2 -- | This module provides the function runIdentity for extracting -- the final result of pure effect interpretations. module Control.Effect.Identity -- | Runs a computation using the Identity monad. -- -- You usually need this when an expression of type Monad m => m -- a remains after handling all the effects and you want to extract -- its pure result. runIdentity :: Identity a -> a -- | This module defines an effect handler which handles tagging, retagging -- and untagging of effects. module Control.Effect.Machinery.Tagger -- | This type provides instances for effect type classes in order to -- enable tagging, retagging and untagging of effects. Whenever this type -- is used as handler of an effect, the effect previously tagged with -- tag will be tagged with new instead. -- -- You usually don't interact with this type directly, since the type -- class instances for this type are generated by the functions found in -- the module Control.Effect.Machinery.TH. newtype Tagger tag new m a Tagger :: m a -> Tagger tag new m a [runTagger] :: Tagger tag new m a -> m a instance forall (b :: * -> *) k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall (b :: * -> *) k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k1 (tag :: k1) k2 (new :: k2). Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Machinery.Tagger.Tagger tag new) instance forall k1 (tag :: k1) k2 (new :: k2). Control.Monad.Trans.Class.MonadTrans (Control.Effect.Machinery.Tagger.Tagger tag new) instance forall k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). GHC.Base.Applicative m => GHC.Base.Applicative (Control.Effect.Machinery.Tagger.Tagger tag new m) -- | This module defines the types EachVia and its corresponding -- type synonym Via which indicate that specific effects are -- handled by a specific monad transformer (also known as effect handler -- or effect interpreter). -- -- It also defines the G type, which is the global tag that is -- used for untagged effects. -- -- Last but not least, it defines some constraint synonyms and kinds that -- are used throughout this library, hopefully to increase the -- readability of the code at some points. module Control.Effect.Machinery.Via -- | This type indicates that the effects (i.e., type classes) -- effs are handled by a specific monad transformer t. -- The type is a simple wrapper around the monad transformer itself. The -- whole purpose of this type is to guide the type system to pick the -- instances of type classes effs given by the type t, -- and to delegate all other effects that are not in effs to -- their handlers which are located somewhere further down the monad -- transformer stack. newtype EachVia (effs :: [Effect]) (t :: Transformer) m a EachVia :: t m a -> EachVia m a [runVia] :: EachVia m a -> t m a -- | This type synonym can be used to indicate that a single effect -- eff is handled by a specific monad transformer t. type Via eff t m a = EachVia '[eff] t m a -- | This type is used as tag for all untagged effects. In order words, -- every effect is tagged, even untagged ones, but all the untagged ones -- simply have the same tag G (short for "Global", because you -- can view tags as some kind of namespace mechanism, and all untagged -- effects live in the same global namespace). -- -- If you don't want to use tagged effects (i.e., you write effect type -- classes without a tag type parameter), you can ignore this type -- completely. data G -- | The kind of monads. type SomeMonad = Type -> Type -- | The kind of effects, which are type classes with a monad type -- parameter at the end. type Effect = SomeMonad -> Constraint -- | The kind of monad transformers, also known as effect handlers or -- effect interpreters. type Transformer = SomeMonad -> Type -> Type -- | This constraint synonym indicates that an effect is handled by a -- specific monad transformer. type Handle (eff :: Effect) (t :: Transformer) m = eff (t m) -- | This constraint synonym indicates that an effect eff is not -- at the head of the type level list of effects to be handled, so the -- effect must be found further down in the tail effs. type Find eff effs t m = (Monad (t m), eff (EachVia effs t m)) -- | This constraint synonym indicates that a first-order effect is not -- handled by a specific monad transformer and must thus be delegated -- ("lifted") further down the monad transformer stack in order to find -- its associated handler. -- -- Roughly speaking, a first-order effect is a type class whose monad -- type parameter m appears only in positive position when -- looking at the types of its corresponding class methods (e.g., -- m appears only in the result type). -- -- An example of a first-order effect is the State' effect. type Lift (eff :: Effect) (t :: Transformer) m = (eff m, Monad (t m), MonadTrans t) -- | This constraint synonym indicates that a higher-order effect is not -- handled by a specific monad transformer and must thus be delegated -- ("lifted") further down the monad transformer stack in order to find -- its associated handler. -- -- Roughly speaking, a higher-order effect is a type class whose monad -- type parameter m appears in negative position when looking at -- the types of its corresponding class methods (e.g., m appears -- in the type of a method parameter). -- -- An example of a higher-order effect is the Reader' effect, -- since its class method local' has a parameter of type m -- a. type Control (eff :: Effect) (t :: Transformer) m = (eff m, Monad (t m), MonadTransControl t) instance Control.Monad.Trans.Control.MonadTransControl t => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Machinery.Via.EachVia effs t) instance Control.Monad.Trans.Class.MonadTrans t => Control.Monad.Trans.Class.MonadTrans (Control.Effect.Machinery.Via.EachVia effs t) instance Control.Monad.IO.Class.MonadIO (t m) => Control.Monad.IO.Class.MonadIO (Control.Effect.Machinery.Via.EachVia effs t m) instance GHC.Base.Monad (t m) => GHC.Base.Monad (Control.Effect.Machinery.Via.EachVia effs t m) instance GHC.Base.Functor (t m) => GHC.Base.Functor (Control.Effect.Machinery.Via.EachVia effs t m) instance GHC.Base.Applicative (t m) => GHC.Base.Applicative (Control.Effect.Machinery.Via.EachVia effs t m) instance (GHC.Base.Monad (t m), Control.Monad.Base.MonadBase b m, Control.Monad.Trans.Class.MonadTrans t) => Control.Monad.Base.MonadBase b (Control.Effect.Machinery.Via.EachVia effs t m) instance (GHC.Base.Monad (t m), Control.Monad.Trans.Control.MonadBaseControl b m, Control.Monad.Trans.Control.MonadTransControl t) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Machinery.Via.EachVia effs t m) -- | This module provides TemplateHaskell functions to generate -- the handling, lifting and tagging infrastructure for effect type -- classes. module Control.Effect.Machinery.TH -- | Generates the effect handling and lifting infrastructure for an effect -- which does not have a tag type parameter. Requires the -- TemplateHaskell language extension. -- -- Consider the following effect type class: -- --
--   class Monad m => MyEffect a b c m where
--     ...
--   
-- -- makeEffect ''MyEffect then generates three instances for this -- effect type class (Lift for first-order effects, Control -- for higher-order effects): -- --
--   instance Handle (MyEffect a b c) t m => MyEffect a b c (EachVia (MyEffect a b c : effs) t m) where
--     ...
--   
--   instance {-# OVERLAPPABLE #-} Find (MyEffect a b c) effs t m => MyEffect a b c (EachVia (other : effs) t m) where
--     ...
--   
--   instance 'Lift'/'Control' (MyEffect a b c) t m => MyEffect a b c (EachVia '[] t m) where
--     ...
--   
-- -- The first instance indicates that MyEffect was found at the -- head of the type level list of effects to be handled, so -- MyEffect is delegated to t. -- -- The second instance indicates that MyEffect was not found at -- the head of the type level list of effects to be handled, so we must -- find MyEffect in the tail effs of the type level -- list. -- -- The third instance indicates that MyEffect could not be found -- in the type level list of effects to be handled, so the effect must be -- delegated further down the monad transformer stack in order to find -- its corresponding effect handler. -- -- Without TemplateHaskell, you have to write these three -- instances by hand. These instances can also be generated separately, -- see makeHandler, makeFinder and makeLifter. makeEffect :: Name -> Q [Dec] -- | Similar to makeEffect, but only generates the effect type class -- instance for handling an effect. makeHandler :: Name -> Q [Dec] -- | Similar to makeEffect, but only generates the effect type class -- instance for finding the effect in the tail of the type level list. makeFinder :: Name -> Q [Dec] -- | Similar to makeEffect, but only generates the effect type class -- instance for lifting an effect. makeLifter :: Name -> Q [Dec] -- | Generates the effect handling and lifting infrastructure for an effect -- which has a tag type parameter. It is expected that the tag type -- parameter is the first type parameter of the effect type class. It is -- also expected that the names of the effect type class and its methods -- end with an apostrophe "'". If you want more control over the naming -- convention, use makeTaggedEffectWith. -- -- In general, this function generates everything that makeEffect -- does, but also some additional things. Consider the following effect -- type class: -- --
--   class Monad m => MyEffect' tag a b c m where
--     methodA' :: a -> m ()
--     methodB' :: b -> m ()
--     methodC' :: c -> m ()
--   
-- -- makeTaggedEffect ''MyEffect' then generates the -- following additional things: -- -- -- -- As a rule of thumb, whenever you see an apostrophe suffix in the name -- of a definition somewhere in this library, it has something to do with -- tags. Most of the time you will use such definitions in combination -- with the language extension TypeApplications, like: -- --
--   ... forall tag ... methodA' @tag ...
--   tagMyEffect' @"newTag" program
--   retagMyEffect' @"oldTag" @"newTag" program
--   untagMyEffect' @"erasedTag" program
--   
-- -- All the tag-related definitions can also be generated separately -- (i.e., without the instances generated by makeEffect), see -- makeTagger and makeTaggerWith. makeTaggedEffect :: Name -> Q [Dec] -- | Similar to makeTaggedEffect, but allows to define a naming -- convention function for the names of the effect type class and its -- methods. This function is used to transform the name of a tagged -- definition (i.e., the type class or its methods) into its untagged -- counterpart. -- -- The default naming convention is enforced by removeApostrophe, -- which simply removes the apostrophe "'" at the end of a name. makeTaggedEffectWith :: (String -> Q String) -> Name -> Q [Dec] -- | Similar to makeTaggedEffect, but only generates the tag-related -- definitions. makeTagger :: Name -> Q [Dec] -- | Similar to makeTaggedEffectWith, but only generates the -- tag-related definitions. makeTaggerWith :: (String -> Q String) -> Name -> Q [Dec] -- | Adds an effect eff to the type level list of effects that -- need to be handled by the transformer t. From a structural -- point of view, this is analogous to lift in the mtl -- ecosystem. This function comes in handy when writing the -- Find-based instance of an effect by hand. liftL :: EachVia effs t m a -> EachVia (eff : effs) t m a -- | Removes an effect eff from the type level list of effects -- that need to be handled by the transformer t. From a -- structural point of view, this is analogous to the run... -- functions in the mtl ecosystem. This function comes in handy -- when writing the Find-based instance of an effect by hand. runL :: EachVia (eff : effs) t m a -> EachVia effs t m a -- | Extracts the untagged name from a name which is expected to end with -- "'". In other words, this function removes the suffix "'" from a given -- name, or fails otherwise. removeApostrophe :: String -> Q String -- | This module exports all the definitions needed to define effects and -- their corresponding handlers. Usually, importing this module is -- everything you need to get started. module Control.Effect.Machinery -- | The error effect, similar to the MonadError type class from -- the mtl library. module Control.Effect.Error -- | An effect that equips a computation with the ability to throw and -- catch exceptions. class Monad m => Error' tag e m | tag m -> e -- | Throws an exception during the computation and begins exception -- processing. throwError' :: Error' tag e m => e -> m a -- | Catches an exception in order to handle it and return to normal -- execution. catchError' :: Error' tag e m => m a -> (e -> m a) -> m a type Error e_akRD = Error' G e_akRD throwError :: Error e_akRD m_akRE => e_akRD -> m_akRE a_akRF catchError :: Error e_akRD m_akRE => m_akRE a_akRG -> (e_akRD -> m_akRE a_akRG) -> m_akRE a_akRG -- | Lifts an Either e into any Error' e. liftEither' :: forall tag e m a. Error' tag e m => Either e a -> m a -- | The untagged version of liftEither'. liftEither :: Error e m => Either e a -> m a -- | Runs the error effect by wrapping exceptions in the Either -- type. runError' :: (Error' tag e `Via` ExceptT e) m a -> m (Either e a) -- | The untagged version of runError'. runError :: (Error e `Via` ExceptT e) m a -> m (Either e a) tagError' :: forall new_akTG e_akRD m_akTH a_akTI. Via (Error' G e_akRD) (Tagger G new_akTG) m_akTH a_akTI -> m_akTH a_akTI retagError' :: forall tag_akTF new_akTG e_akRD m_akTJ a_akTK. Via (Error' tag_akTF e_akRD) (Tagger tag_akTF new_akTG) m_akTJ a_akTK -> m_akTJ a_akTK untagError' :: forall tag_akTF e_akRD m_akTL a_akTM. Via (Error' tag_akTF e_akRD) (Tagger tag_akTF G) m_akTL a_akTM -> m_akTL a_akTM instance forall k (tag :: k) e (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.Error.Error' tag e) t m => Control.Effect.Error.Error' tag e (Control.Effect.Machinery.Via.EachVia (Control.Effect.Error.Error' tag e : effs) t m) instance forall k (tag :: k) e (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.Error.Error' tag e) effs t m => Control.Effect.Error.Error' tag e (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) e (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *). Control.Effect.Machinery.Via.Control (Control.Effect.Error.Error' tag e) t m => Control.Effect.Error.Error' tag e (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (new :: k1) e (m :: * -> *) (tag :: k2). Control.Effect.Error.Error' new e m => Control.Effect.Error.Error' tag e (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k (m :: * -> *) (tag :: k) e. GHC.Base.Monad m => Control.Effect.Error.Error' tag e (Control.Monad.Trans.Except.ExceptT e m) -- | The embed effect for integrating arbitrary monads into the effect -- system. module Control.Effect.Embed -- | An effect that integrates a monad n into the computation -- m. class Monad m => Embed' tag n m | tag m -> n -- | Monadic actions in n can be lifted into m via -- embed. -- -- embed is like liftIO, but not limited to IO. In -- fact, liftIO can be realized using embed by specializing -- n to IO. embed' :: Embed' tag n m => n a -> m a type Embed n_alYz = Embed' G n_alYz embed :: Embed n_alYz m_alYA => n_alYz a_alYB -> m_alYA a_alYB -- | The transformation interpreter of the embed effect. This type -- implements the Embed type class by transforming the integrated -- monad n into another integrated monad t via natural -- transformation. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data Transformation n t m a -- | Runs the embed effect by transforming the integrated monad n -- into another integrated monad t. runEmbed' :: forall tag n t m a. (forall b. n b -> t b) -> (Embed' tag n `Via` Transformation n t) m a -> m a -- | The untagged version of runEmbed'. runEmbed :: (forall b. n b -> t b) -> (Embed n `Via` Transformation n t) m a -> m a -- | The finalization interpreter of the embed effect. This type implements -- the Embed type class by declaring the integrated monad the -- final monad m (also called the "base monad"). -- -- Chances are very high that you only need this interpreter if you have -- a custom final monad because the Embed' effect is already -- implemented for final monads like IO, Maybe, [] -- and Identity. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data Finalization m a -- | Runs the embed effect by declaring the integrated monad the final -- monad. runFinal' :: (Embed' tag m `Via` Finalization) m a -> m a -- | The untagged version of runFinal'. runFinal :: (Embed m `Via` Finalization) m a -> m a tagEmbed' :: forall new_alZH n_alYz m_alZI a_alZJ. Via (Embed' G n_alYz) (Tagger G new_alZH) m_alZI a_alZJ -> m_alZI a_alZJ retagEmbed' :: forall tag_alZG new_alZH n_alYz m_alZK a_alZL. Via (Embed' tag_alZG n_alYz) (Tagger tag_alZG new_alZH) m_alZK a_alZL -> m_alZK a_alZL untagEmbed' :: forall tag_alZG n_alYz m_alZM a_alZN. Via (Embed' tag_alZG n_alYz) (Tagger tag_alZG G) m_alZM a_alZN -> m_alZM a_alZN instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Embed.Finalization m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Embed.Finalization m) instance Control.Monad.Trans.Control.MonadTransControl Control.Effect.Embed.Finalization instance Control.Monad.Trans.Class.MonadTrans Control.Effect.Embed.Finalization instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Embed.Finalization m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Embed.Finalization m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Embed.Finalization m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Control.Effect.Embed.Finalization m) instance forall (b :: * -> *) k (n :: k -> *) (t :: k -> *) (m :: * -> *). Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Embed.Transformation n t m) instance forall (b :: * -> *) k (n :: k -> *) (t :: k -> *) (m :: * -> *). Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Embed.Transformation n t m) instance forall k (n :: k -> *) (t :: k -> *). Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Embed.Transformation n t) instance forall k (n :: k -> *) (t :: k -> *). Control.Monad.Trans.Class.MonadTrans (Control.Effect.Embed.Transformation n t) instance forall k (n :: k -> *) (t :: k -> *) (m :: * -> *). Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Embed.Transformation n t m) instance forall k (n :: k -> *) (t :: k -> *) (m :: * -> *). GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Embed.Transformation n t m) instance forall k (n :: k -> *) (t :: k -> *) (m :: * -> *). GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Embed.Transformation n t m) instance forall k (n :: k -> *) (t :: k -> *) (m :: * -> *). GHC.Base.Applicative m => GHC.Base.Applicative (Control.Effect.Embed.Transformation n t m) instance forall k (n :: * -> *) (tag :: k). GHC.Base.Monad n => Control.Effect.Embed.Embed' tag n (Control.Effect.Embed.Finalization n) instance forall k (tag :: k) (t :: * -> *) (m :: * -> *) (n :: * -> *). Control.Effect.Embed.Embed' tag t m => Control.Effect.Embed.Embed' tag n (Control.Effect.Embed.Transformation n t m) instance forall k (tag :: k) (n :: * -> *) (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.Embed.Embed' tag n) t m => Control.Effect.Embed.Embed' tag n (Control.Effect.Machinery.Via.EachVia (Control.Effect.Embed.Embed' tag n : effs) t m) instance forall k (tag :: k) (n :: * -> *) (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.Embed.Embed' tag n) effs t m => Control.Effect.Embed.Embed' tag n (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) (n :: * -> *) (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *). Control.Effect.Machinery.Via.Lift (Control.Effect.Embed.Embed' tag n) t m => Control.Effect.Embed.Embed' tag n (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (new :: k1) (n :: * -> *) (m :: * -> *) (tag :: k2). Control.Effect.Embed.Embed' new n m => Control.Effect.Embed.Embed' tag n (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k (tag :: k). Control.Effect.Embed.Embed' tag GHC.Types.IO GHC.Types.IO instance forall k (tag :: k). Control.Effect.Embed.Embed' tag GHC.Maybe.Maybe GHC.Maybe.Maybe instance forall k (tag :: k). Control.Effect.Embed.Embed' tag [] [] instance forall k (tag :: k). Control.Effect.Embed.Embed' tag Data.Functor.Identity.Identity Data.Functor.Identity.Identity -- | The continuation effect, similar to the MonadCont type class -- from the mtl library. module Control.Effect.Cont -- | An effect that adds an abortive continuation to a computation. class Monad m => Cont' tag m -- | Adapted from the mtl library documentation: -- -- callCC' (call-with-current-continuation) calls a function -- with the current continuation as its argument. Provides an escape -- continuation mechanism for use with continuation monads. Escape -- continuations allow to abort the current computation and return a -- value immediately. They achieve a similar result to throwError' -- and catchError' of the Error' effect. Advantage of this -- function over calling return is that it makes the -- continuation explicit, allowing more flexibility and better control. -- -- The standard idiom used with callCC' is to provide a -- lambda-expression to name the continuation. Then calling the named -- continuation anywhere within its scope will escape from the -- computation, even if it is many layers deep within nested -- computations. callCC' :: Cont' tag m => ((a -> m b) -> m a) -> m a type Cont = Cont' G callCC :: Cont m_aoKO => ((a_aoKP -> m_aoKO b_aoKQ) -> m_aoKO a_aoKP) -> m_aoKO a_aoKP -- | Runs the continuation effect with a given final continuation. runCont' :: forall tag r m a. (a -> m r) -> (Cont' tag `Via` ContT r) m a -> m r -- | The untagged version of runCont'. runCont :: (a -> m r) -> (Cont `Via` ContT r) m a -> m r -- | Runs the continuation effect with pure as final continuation. evalCont' :: forall tag r m. Applicative m => (Cont' tag `Via` ContT r) m r -> m r -- | The untagged version of evalCont'. evalCont :: Applicative m => (Cont `Via` ContT r) m r -> m r tagCont' :: forall new_aoQH m_aoQI a_aoQJ. Via (Cont' G) (Tagger G new_aoQH) m_aoQI a_aoQJ -> m_aoQI a_aoQJ retagCont' :: forall tag_aoQG new_aoQH m_aoQK a_aoQL. Via (Cont' tag_aoQG) (Tagger tag_aoQG new_aoQH) m_aoQK a_aoQL -> m_aoQK a_aoQL untagCont' :: forall tag_aoQG m_aoQM a_aoQN. Via (Cont' tag_aoQG) (Tagger tag_aoQG G) m_aoQM a_aoQN -> m_aoQM a_aoQN instance forall k1 k2 (new :: k1) (m :: * -> *) (tag :: k2). Control.Effect.Cont.Cont' new m => Control.Effect.Cont.Cont' tag (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k (tag :: k) (t :: Control.Effect.Machinery.Via.Transformer) (m :: Control.Effect.Machinery.Via.SomeMonad). Control.Effect.Machinery.Via.Control (Control.Effect.Cont.Cont' tag) t m => Control.Effect.Cont.Cont' tag (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (tag :: k2) (r :: k1) (m :: k1 -> *). Control.Effect.Cont.Cont' tag (Control.Monad.Trans.Cont.ContT r m) instance forall k (tag :: k) (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.Cont.Cont' tag) effs t m => Control.Effect.Cont.Cont' tag (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.Cont.Cont' tag) t m => Control.Effect.Cont.Cont' tag (Control.Effect.Machinery.Via.EachVia (Control.Effect.Cont.Cont' tag : effs) t m) -- | The managed effect allows a computation to allocate resources which -- are guaranteed to be released after the end of the computation. This -- effect provides a monadic interface for managing one or more -- long-living resources in a more readable way than nesting -- bracket-style operations of the Control.Effect.Resource -- effect. module Control.Effect.Managed -- | An effect that allows a computation to allocate resources which are -- guaranteed to be released after the computation. class Monad m => Managed' tag m -- | Acquire a resource by specifying an acquisition action and a release -- action to be used for cleanup after the computation. manage' :: Managed' tag m => m a -> (a -> m b) -> m a type Managed = Managed' G manage :: Managed m_apD7 => m_apD7 a_apD8 -> (a_apD8 -> m_apD7 b_apD9) -> m_apD7 a_apD8 -- | The bracket-based interpreter of the managed effect. This type -- implements the Managed' type class by using bracket, -- thus requiring IO at the bottom of the monad transformer stack. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data Bracket n m a -- | Runs the managed effect using bracket. runManaged' :: forall tag m a. MonadBaseControl IO m => (Managed' tag `Via` Bracket m) m a -> m a -- | The untagged version of runManaged'. runManaged :: MonadBaseControl IO m => (Managed `Via` Bracket m) m a -> m a tagManaged' :: forall new_apEy m_apEz a_apEA. Via (Managed' G) (Tagger G new_apEy) m_apEz a_apEA -> m_apEz a_apEA retagManaged' :: forall tag_apEx new_apEy m_apEB a_apEC. Via (Managed' tag_apEx) (Tagger tag_apEx new_apEy) m_apEB a_apEC -> m_apEB a_apEC untagManaged' :: forall tag_apEx m_apED a_apEE. Via (Managed' tag_apEx) (Tagger tag_apEx G) m_apED a_apEE -> m_apED a_apEE instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Managed.Bracket n m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Managed.Bracket n m) instance Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Managed.Bracket n) instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Managed.Bracket n) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Managed.Bracket n m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Managed.Bracket n m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Managed.Bracket n m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Control.Effect.Managed.Bracket n m) instance forall k (m :: * -> *) (tag :: k). Control.Monad.Base.MonadBase GHC.Types.IO m => Control.Effect.Managed.Managed' tag (Control.Effect.Managed.Bracket m m) instance forall k (tag :: k) (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.Managed.Managed' tag) t m => Control.Effect.Managed.Managed' tag (Control.Effect.Machinery.Via.EachVia (Control.Effect.Managed.Managed' tag : effs) t m) instance forall k (tag :: k) (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.Managed.Managed' tag) effs t m => Control.Effect.Managed.Managed' tag (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *). Control.Effect.Machinery.Via.Control (Control.Effect.Managed.Managed' tag) t m => Control.Effect.Managed.Managed' tag (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (new :: k1) (m :: * -> *) (tag :: k2). Control.Effect.Managed.Managed' new m => Control.Effect.Managed.Managed' tag (Control.Effect.Machinery.Tagger.Tagger tag new m) -- | The map effect for modeling a mutable collection of key-value pairs. -- -- Lazy and strict interpretations of the effect are available here: -- Control.Effect.Map.Lazy and Control.Effect.Map.Strict. module Control.Effect.Map -- | An effect that adds a mutable collection of key-value pairs to a given -- computation. class Monad m => Map' tag k v m | tag m -> k v -- | Deletes all key-value pairs from the map. clear' :: Map' tag k v m => m () -- | Searches for a value that corresponds to a given key. Returns -- Nothing if the key cannot be found. lookup' :: Map' tag k v m => k -> m (Maybe v) -- | Updates the value that corresponds to a given key. Passing -- Nothing as the updated value removes the key-value pair from -- the map. update' :: Map' tag k v m => k -> Maybe v -> m () type Map k_arZe v_arZf = Map' G k_arZe v_arZf clear :: Map k_arZe v_arZf m_arZg => m_arZg () lookup :: Map k_arZe v_arZf m_arZg => k_arZe -> m_arZg (Maybe v_arZf) update :: Map k_arZe v_arZf m_arZg => k_arZe -> Maybe v_arZf -> m_arZg () -- | Deletes a key and its corresponding value from the map. delete' :: forall tag k v m. Map' tag k v m => k -> m () -- | The untagged version of delete'. delete :: Map k v m => k -> m () -- | Checks if the map contains a given key. exists' :: forall tag k v m. Map' tag k v m => k -> m Bool -- | The untagged version of exists'. exists :: Map k v m => k -> m Bool -- | Inserts a new key-value pair into the map. If the key is already -- present in the map, the associated value is replaced with the new -- value. insert' :: forall tag k v m. Map' tag k v m => k -> v -> m () -- | The untagged version of insert'. insert :: Map k v m => k -> v -> m () -- | Updates the value that corresponds to a given key. If the key cannot -- be found, a corresponding default value is assumed. modify' :: forall tag k v m. Map' tag k v m => v -> (v -> v) -> k -> m () -- | The untagged version of modify'. modify :: Map k v m => v -> (v -> v) -> k -> m () tagMap' :: forall new_as1h k_arZe v_arZf m_as1i a_as1j. Via (Map' G k_arZe v_arZf) (Tagger G new_as1h) m_as1i a_as1j -> m_as1i a_as1j retagMap' :: forall tag_as1g new_as1h k_arZe v_arZf m_as1k a_as1l. Via (Map' tag_as1g k_arZe v_arZf) (Tagger tag_as1g new_as1h) m_as1k a_as1l -> m_as1k a_as1l untagMap' :: forall tag_as1g k_arZe v_arZf m_as1m a_as1n. Via (Map' tag_as1g k_arZe v_arZf) (Tagger tag_as1g G) m_as1m a_as1n -> m_as1m a_as1n instance forall k1 (tag :: k1) k2 v (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.Map.Map' tag k2 v) t m => Control.Effect.Map.Map' tag k2 v (Control.Effect.Machinery.Via.EachVia (Control.Effect.Map.Map' tag k2 v : effs) t m) instance forall k1 (tag :: k1) k2 v (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.Map.Map' tag k2 v) effs t m => Control.Effect.Map.Map' tag k2 v (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k1 (tag :: k1) k2 v (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *). Control.Effect.Machinery.Via.Lift (Control.Effect.Map.Map' tag k2 v) t m => Control.Effect.Map.Map' tag k2 v (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (new :: k1) k3 v (m :: * -> *) (tag :: k2). Control.Effect.Map.Map' new k3 v m => Control.Effect.Map.Map' tag k3 v (Control.Effect.Machinery.Tagger.Tagger tag new m) -- | Lazy interpretations of the Map' effect. -- -- If you don't require disambiguation of multiple map effects (i.e., you -- only have one map effect in your monadic context), you usually need -- the untagged interpretations. module Control.Effect.Map.Lazy -- | The lazy interpreter of the map effect. This type implements the -- Map' type class in a lazy manner. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data LazyMap k v m a -- | Runs the map effect, initialized with an empty map. runMap' :: forall tag k v m a. Monad m => (Map' tag k v `Via` LazyMap k v) m a -> m a -- | The untagged version of runMap'. runMap :: Monad m => (Map k v `Via` LazyMap k v) m a -> m a instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Map.Lazy.LazyMap k v m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Map.Lazy.LazyMap k v m) instance Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Map.Lazy.LazyMap k v) instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Map.Lazy.LazyMap k v) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Map.Lazy.LazyMap k v m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Map.Lazy.LazyMap k v m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Map.Lazy.LazyMap k v m) instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Map.Lazy.LazyMap k v m) instance forall k1 (m :: * -> *) k2 (tag :: k1) v. (GHC.Base.Monad m, GHC.Classes.Ord k2) => Control.Effect.Map.Map' tag k2 v (Control.Effect.Map.Lazy.LazyMap k2 v m) -- | Strict interpretations of the Map' effect. -- -- If you don't require disambiguation of multiple map effects (i.e., you -- only have one map effect in your monadic context), you usually need -- the untagged interpretations. module Control.Effect.Map.Strict -- | The strict interpreter of the map effect. This type implements the -- Map' type class in a strict manner. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data StrictMap k v m a -- | Runs the map effect, initialized with an empty map. runMap' :: forall tag k v m a. Monad m => (Map' tag k v `Via` StrictMap k v) m a -> m a -- | The untagged version of runMap'. runMap :: Monad m => (Map k v `Via` StrictMap k v) m a -> m a instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Map.Strict.StrictMap k v m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Map.Strict.StrictMap k v m) instance Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Map.Strict.StrictMap k v) instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Map.Strict.StrictMap k v) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Map.Strict.StrictMap k v m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Map.Strict.StrictMap k v m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Map.Strict.StrictMap k v m) instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Map.Strict.StrictMap k v m) instance forall k1 (m :: * -> *) k2 (tag :: k1) v. (GHC.Base.Monad m, GHC.Classes.Ord k2) => Control.Effect.Map.Map' tag k2 v (Control.Effect.Map.Strict.StrictMap k2 v m) -- | The reader effect, similar to the MonadReader type class from -- the mtl library. module Control.Effect.Reader -- | An effect that adds an immutable state (i.e., an "environment") to a -- given computation. The effect allows to read values from the -- environment, pass values from function to function, and execute -- sub-computations in a modified environment. class Monad m => Reader' tag r m | tag m -> r -- | Gets the environment. ask' :: Reader' tag r m => m r -- | Executes a sub-computation in a modified environment. local' :: Reader' tag r m => (r -> r) -> m a -> m a -- | Gets a specific component of the environment, using the provided -- projection function. reader' :: Reader' tag r m => (r -> a) -> m a type Reader r_auIj = Reader' G r_auIj ask :: Reader r_auIj m_auIk => m_auIk r_auIj local :: Reader r_auIj m_auIk => (r_auIj -> r_auIj) -> m_auIk a_auIl -> m_auIk a_auIl reader :: Reader r_auIj m_auIk => (r_auIj -> a_auIm) -> m_auIk a_auIm -- | Gets a specific component of the environment, using the provided -- projection function. asks' :: forall tag r m a. Reader' tag r m => (r -> a) -> m a -- | The untagged version of asks'. asks :: Reader r m => (r -> a) -> m a -- | Runs the reader effect. runReader' :: forall tag r m a. r -> (Reader' tag r `Via` ReaderT r) m a -> m a -- | The untagged version of runReader'. runReader :: r -> (Reader r `Via` ReaderT r) m a -> m a tagReader' :: forall new_auL6 r_auIj m_auL7 a_auL8. Via (Reader' G r_auIj) (Tagger G new_auL6) m_auL7 a_auL8 -> m_auL7 a_auL8 retagReader' :: forall tag_auL5 new_auL6 r_auIj m_auL9 a_auLa. Via (Reader' tag_auL5 r_auIj) (Tagger tag_auL5 new_auL6) m_auL9 a_auLa -> m_auL9 a_auLa untagReader' :: forall tag_auL5 r_auIj m_auLb a_auLc. Via (Reader' tag_auL5 r_auIj) (Tagger tag_auL5 G) m_auLb a_auLc -> m_auLb a_auLc instance forall k (tag :: k) r (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.Reader.Reader' tag r) t m => Control.Effect.Reader.Reader' tag r (Control.Effect.Machinery.Via.EachVia (Control.Effect.Reader.Reader' tag r : effs) t m) instance forall k (tag :: k) r (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.Reader.Reader' tag r) effs t m => Control.Effect.Reader.Reader' tag r (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) r (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *). Control.Effect.Machinery.Via.Control (Control.Effect.Reader.Reader' tag r) t m => Control.Effect.Reader.Reader' tag r (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (new :: k1) r (m :: * -> *) (tag :: k2). Control.Effect.Reader.Reader' new r m => Control.Effect.Reader.Reader' tag r (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k (m :: * -> *) (tag :: k) r. GHC.Base.Monad m => Control.Effect.Reader.Reader' tag r (Control.Monad.Trans.Reader.ReaderT r m) instance forall k (m :: * -> *) w (tag :: k) r s. (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.Reader.Reader' tag r (Control.Monad.Trans.RWS.Lazy.RWST r w s m) instance forall k (m :: * -> *) (tag :: k) r w s. GHC.Base.Monad m => Control.Effect.Reader.Reader' tag r (Control.Monad.Trans.RWS.CPS.RWST r w s m) -- | The resource effect allows a computation to allocate resources which -- are guaranteed to be released after their usage. module Control.Effect.Resource -- | An effect that allows a computation to allocate resources which are -- guaranteed to be released after their usage. class Monad m => Resource' tag m -- | Acquire a resource, use it, and then release the resource after usage. bracket' :: Resource' tag m => m a -> (a -> m c) -> (a -> m b) -> m b -- | Like bracket', but only performs the release computation if the -- usage computation throws an exception. bracketOnError' :: Resource' tag m => m a -> (a -> m c) -> (a -> m b) -> m b type Resource = Resource' G bracket :: Resource m_aw1c => m_aw1c a_aw1d -> (a_aw1d -> m_aw1c c_aw1e) -> (a_aw1d -> m_aw1c b_aw1f) -> m_aw1c b_aw1f bracketOnError :: Resource m_aw1c => m_aw1c a_aw1g -> (a_aw1g -> m_aw1c c_aw1h) -> (a_aw1g -> m_aw1c b_aw1i) -> m_aw1c b_aw1i -- | A simpler version of bracket' where one computation is -- guaranteed to run after another. finally' :: forall tag m a b. Resource' tag m => m a -> m b -> m a -- | The untagged version of finally'. finally :: Resource m => m a -> m b -> m a -- | A simpler version of bracketOnError' where one computation is -- guaranteed to run after another in case the first computation throws -- an exception. onException' :: forall tag m a b. Resource' tag m => m a -> m b -> m a -- | The untagged version of onException'. onException :: Resource m => m a -> m b -> m a -- | The IO-based interpreter of the resource effect. This type implements -- the Resource' type class by using bracket, thus -- requiring IO at the bottom of the monad transformer stack. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data LowerIO m a -- | Runs the resource effect using bracket. runResourceIO' :: (Resource' tag `Via` LowerIO) m a -> m a -- | The untagged version of runResourceIO'. runResourceIO :: (Resource `Via` LowerIO) m a -> m a tagResource' :: forall new_aw4t m_aw4u a_aw4v. Via (Resource' G) (Tagger G new_aw4t) m_aw4u a_aw4v -> m_aw4u a_aw4v retagResource' :: forall tag_aw4s new_aw4t m_aw4w a_aw4x. Via (Resource' tag_aw4s) (Tagger tag_aw4s new_aw4t) m_aw4w a_aw4x -> m_aw4w a_aw4x untagResource' :: forall tag_aw4s m_aw4y a_aw4z. Via (Resource' tag_aw4s) (Tagger tag_aw4s G) m_aw4y a_aw4z -> m_aw4y a_aw4z instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Resource.LowerIO m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Resource.LowerIO m) instance Control.Monad.Trans.Control.MonadTransControl Control.Effect.Resource.LowerIO instance Control.Monad.Trans.Class.MonadTrans Control.Effect.Resource.LowerIO instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Resource.LowerIO m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Resource.LowerIO m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Resource.LowerIO m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Control.Effect.Resource.LowerIO m) instance forall k (m :: * -> *) (tag :: k). Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Control.Effect.Resource.Resource' tag (Control.Effect.Resource.LowerIO m) instance forall k (tag :: k) (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.Resource.Resource' tag) t m => Control.Effect.Resource.Resource' tag (Control.Effect.Machinery.Via.EachVia (Control.Effect.Resource.Resource' tag : effs) t m) instance forall k (tag :: k) (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.Resource.Resource' tag) effs t m => Control.Effect.Resource.Resource' tag (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *). Control.Effect.Machinery.Via.Control (Control.Effect.Resource.Resource' tag) t m => Control.Effect.Resource.Resource' tag (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (new :: k1) (m :: * -> *) (tag :: k2). Control.Effect.Resource.Resource' new m => Control.Effect.Resource.Resource' tag (Control.Effect.Machinery.Tagger.Tagger tag new m) -- | The state effect, similar to the MonadState type class from -- the mtl library. -- -- Lazy and strict interpretations of the effect are available here: -- Control.Effect.State.Lazy and -- Control.Effect.State.Strict. module Control.Effect.State -- | An effect that adds a mutable state to a given computation. class Monad m => State' tag s m | tag m -> s -- | Gets the current state. get' :: State' tag s m => m s -- | Replaces the state with a new value. put' :: State' tag s m => s -> m () -- | Updates the state and produces a value based on the current state. state' :: State' tag s m => (s -> (s, a)) -> m a type State s_az0d = State' G s_az0d get :: State s_az0d m_az0e => m_az0e s_az0d put :: State s_az0d m_az0e => s_az0d -> m_az0e () state :: State s_az0d m_az0e => (s_az0d -> (s_az0d, a_az0f)) -> m_az0e a_az0f -- | Gets a specific component of the state, using the provided projection -- function. gets' :: forall tag s m a. State' tag s m => (s -> a) -> m a -- | The untagged version of gets'. gets :: State s m => (s -> a) -> m a -- | Modifies the state, using the provided function. modify' :: forall tag s m. State' tag s m => (s -> s) -> m () -- | The untagged version of modify'. modify :: State s m => (s -> s) -> m () -- | Modifies the state, using the provided function. The computation is -- strict in the new state. modifyStrict' :: forall tag s m. State' tag s m => (s -> s) -> m () -- | The untagged version of modifyStrict'. modifyStrict :: State s m => (s -> s) -> m () tagState' :: forall new_az36 s_az0d m_az37 a_az38. Via (State' G s_az0d) (Tagger G new_az36) m_az37 a_az38 -> m_az37 a_az38 retagState' :: forall tag_az35 new_az36 s_az0d m_az39 a_az3a. Via (State' tag_az35 s_az0d) (Tagger tag_az35 new_az36) m_az39 a_az3a -> m_az39 a_az3a untagState' :: forall tag_az35 s_az0d m_az3b a_az3c. Via (State' tag_az35 s_az0d) (Tagger tag_az35 G) m_az3b a_az3c -> m_az3b a_az3c instance forall k (tag :: k) s (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.State.State' tag s) t m => Control.Effect.State.State' tag s (Control.Effect.Machinery.Via.EachVia (Control.Effect.State.State' tag s : effs) t m) instance forall k (tag :: k) s (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.State.State' tag s) effs t m => Control.Effect.State.State' tag s (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) s (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *). Control.Effect.Machinery.Via.Lift (Control.Effect.State.State' tag s) t m => Control.Effect.State.State' tag s (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (new :: k1) s (m :: * -> *) (tag :: k2). Control.Effect.State.State' new s m => Control.Effect.State.State' tag s (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k (m :: * -> *) (tag :: k) s. GHC.Base.Monad m => Control.Effect.State.State' tag s (Control.Monad.Trans.State.Lazy.StateT s m) instance forall k (m :: * -> *) (tag :: k) s. GHC.Base.Monad m => Control.Effect.State.State' tag s (Control.Monad.Trans.State.Strict.StateT s m) instance forall k (m :: * -> *) w (tag :: k) s r. (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.State.State' tag s (Control.Monad.Trans.RWS.Lazy.RWST r w s m) instance forall k (m :: * -> *) (tag :: k) s r w. GHC.Base.Monad m => Control.Effect.State.State' tag s (Control.Monad.Trans.RWS.CPS.RWST r w s m) -- | Lazy interpretations of the State' effect. -- -- If you don't require disambiguation of multiple state effects (i.e., -- you only have one state effect in your monadic context), you usually -- need the untagged interpretations. module Control.Effect.State.Lazy -- | Runs the state effect and discards the final state. evalState' :: forall tag s m a. Functor m => s -> (State' tag s `Via` StateT s) m a -> m a -- | Runs the state effect and discards the result of the interpreted -- program. execState' :: forall tag s m a. Functor m => s -> (State' tag s `Via` StateT s) m a -> m s -- | Runs the state effect and returns both the final state and the result -- of the interpreted program. runState' :: forall tag s m a. Functor m => s -> (State' tag s `Via` StateT s) m a -> m (s, a) -- | The untagged version of evalState'. evalState :: Functor m => s -> (State s `Via` StateT s) m a -> m a -- | The untagged version of execState'. execState :: Functor m => s -> (State s `Via` StateT s) m a -> m s -- | The untagged version of runState'. runState :: Functor m => s -> (State s `Via` StateT s) m a -> m (s, a) -- | Strict interpretations of the State' effect. -- -- If you don't require disambiguation of multiple state effects (i.e., -- you only have one state effect in your monadic context), you usually -- need the untagged interpretations. module Control.Effect.State.Strict -- | Runs the state effect and discards the final state. evalState' :: forall tag s m a. Functor m => s -> (State' tag s `Via` StateT s) m a -> m a -- | Runs the state effect and returns the final state. execState' :: forall tag s m a. Functor m => s -> (State' tag s `Via` StateT s) m a -> m s -- | Runs the state effect and returns both the final state and the result -- of the interpreted program. runState' :: forall tag s m a. Functor m => s -> (State' tag s `Via` StateT s) m a -> m (s, a) -- | The untagged version of evalState'. evalState :: Functor m => s -> (State s `Via` StateT s) m a -> m a -- | The untagged version of execState'. execState :: Functor m => s -> (State s `Via` StateT s) m a -> m s -- | The untagged version of runState'. runState :: Functor m => s -> (State s `Via` StateT s) m a -> m (s, a) -- | The writer effect, similar to the MonadWriter type class from -- the mtl library. -- -- Lazy and strict interpretations of the effect are available here: -- Control.Effect.Writer.Lazy and -- Control.Effect.Writer.Strict. module Control.Effect.Writer -- | An effect that adds a write-only, accumulated output to a given -- computation. class Monad m => Writer' tag w m | tag m -> w -- | Produces the output w. In other words, w is appended -- to the accumulated output. tell' :: Writer' tag w m => w -> m () -- | Executes a sub-computation and appends w to the accumulated -- output. listen' :: Writer' tag w m => m a -> m (w, a) -- | Executes a sub-computation and applies the function to its output. censor' :: Writer' tag w m => (w -> w) -> m a -> m a type Writer w_aAGU = Writer' G w_aAGU tell :: Writer w_aAGU m_aAGV => w_aAGU -> m_aAGV () listen :: Writer w_aAGU m_aAGV => m_aAGV a_aAGW -> m_aAGV (w_aAGU, a_aAGW) censor :: Writer w_aAGU m_aAGV => (w_aAGU -> w_aAGU) -> m_aAGV a_aAGX -> m_aAGV a_aAGX -- | Executes a sub-computation and applies the function to its output, -- thus adding an additional value to the result of the sub-computation. listens' :: forall tag w b m a. Writer' tag w m => (w -> b) -> m a -> m (b, a) -- | The untagged version of listens'. listens :: Writer w m => (w -> b) -> m a -> m (b, a) tagWriter' :: forall new_aAJm w_aAGU m_aAJn a_aAJo. Via (Writer' G w_aAGU) (Tagger G new_aAJm) m_aAJn a_aAJo -> m_aAJn a_aAJo retagWriter' :: forall tag_aAJl new_aAJm w_aAGU m_aAJp a_aAJq. Via (Writer' tag_aAJl w_aAGU) (Tagger tag_aAJl new_aAJm) m_aAJp a_aAJq -> m_aAJp a_aAJq untagWriter' :: forall tag_aAJl w_aAGU m_aAJr a_aAJs. Via (Writer' tag_aAJl w_aAGU) (Tagger tag_aAJl G) m_aAJr a_aAJs -> m_aAJr a_aAJs instance forall k (tag :: k) w (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *) (effs :: [(* -> *) -> GHC.Types.Constraint]). Control.Effect.Machinery.Via.Handle (Control.Effect.Writer.Writer' tag w) t m => Control.Effect.Writer.Writer' tag w (Control.Effect.Machinery.Via.EachVia (Control.Effect.Writer.Writer' tag w : effs) t m) instance forall k (tag :: k) w (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: * -> *) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.Writer.Writer' tag w) effs t m => Control.Effect.Writer.Writer' tag w (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) w (t :: Control.Effect.Machinery.Via.Transformer) (m :: * -> *). Control.Effect.Machinery.Via.Control (Control.Effect.Writer.Writer' tag w) t m => Control.Effect.Writer.Writer' tag w (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k1 k2 (new :: k1) w (m :: * -> *) (tag :: k2). Control.Effect.Writer.Writer' new w m => Control.Effect.Writer.Writer' tag w (Control.Effect.Machinery.Tagger.Tagger tag new m) instance forall k (m :: * -> *) w (tag :: k). (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.Writer.Writer' tag w (Control.Monad.Trans.Writer.Lazy.WriterT w m) instance forall k (m :: * -> *) w (tag :: k). (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.Writer.Writer' tag w (Control.Monad.Trans.Writer.CPS.WriterT w m) instance forall k (m :: * -> *) w (tag :: k) r s. (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.Writer.Writer' tag w (Control.Monad.Trans.RWS.Lazy.RWST r w s m) instance forall k (m :: * -> *) w (tag :: k) r s. (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.Writer.Writer' tag w (Control.Monad.Trans.RWS.CPS.RWST r w s m) -- | The effect that combines the reader, writer and state effect, similar -- to the MonadRWS type class from the mtl library. -- -- Lazy and strict interpretations of the effect are available here: -- Control.Effect.RWS.Lazy and Control.Effect.RWS.Strict. module Control.Effect.RWS -- | An effect that adds the following features to a given computation: -- -- class (Reader' tag r m, Writer' tag w m, State' tag s m) => RWS' tag r w s m | tag m -> r w s type RWS r w s = RWS' G r w s -- | The separation interpreter of the RWS effect. This type implements the -- RWS' type class by splitting the effect into separate -- Reader', Writer' and State' effects which can -- then be interpreted individually. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data Separation m a -- | Runs the RWS effect via separation. runSeparatedRWS' :: ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` Separation) m a -> m a -- | The untagged version of runSeparatedRWS'. runSeparatedRWS :: ('[RWS r w s, Reader r, Writer w, State s] `EachVia` Separation) m a -> m a -- | The tagging interpreter of the RWS effect. This type implements the -- RWS' type class by tagging/retagging/untagging its reader, -- writer and state components. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data Tagger tag new m a tagRWS' :: forall new r w s m a. ('[RWS' G r w s, Reader' G r, Writer' G w, State' G s] `EachVia` Tagger G new) m a -> m a retagRWS' :: forall tag new r w s m a. ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` Tagger tag new) m a -> m a untagRWS' :: forall tag r w s m a. ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` Tagger tag G) m a -> m a instance forall (b :: * -> *) k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.RWS.Tagger tag new m) instance forall (b :: * -> *) k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.RWS.Tagger tag new m) instance forall k1 (tag :: k1) k2 (new :: k2). Control.Monad.Trans.Control.MonadTransControl (Control.Effect.RWS.Tagger tag new) instance forall k1 (tag :: k1) k2 (new :: k2). Control.Monad.Trans.Class.MonadTrans (Control.Effect.RWS.Tagger tag new) instance forall k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.RWS.Tagger tag new m) instance forall k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.RWS.Tagger tag new m) instance forall k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.RWS.Tagger tag new m) instance forall k1 (tag :: k1) k2 (new :: k2) (m :: * -> *). GHC.Base.Applicative m => GHC.Base.Applicative (Control.Effect.RWS.Tagger tag new m) instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.RWS.Separation m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.RWS.Separation m) instance Control.Monad.Trans.Control.MonadTransControl Control.Effect.RWS.Separation instance Control.Monad.Trans.Class.MonadTrans Control.Effect.RWS.Separation instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.RWS.Separation m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.RWS.Separation m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.RWS.Separation m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Control.Effect.RWS.Separation m) instance forall k1 k2 (new :: k2) r w s (m :: * -> *) (tag :: k1). Control.Effect.RWS.RWS' new r w s m => Control.Effect.RWS.RWS' tag r w s (Control.Effect.RWS.Tagger tag new m) instance forall k1 k2 (new :: k2) r w s (m :: * -> *) (tag :: k1). Control.Effect.RWS.RWS' new r w s m => Control.Effect.Reader.Reader' tag r (Control.Effect.RWS.Tagger tag new m) instance forall k1 k2 (new :: k2) r w s (m :: * -> *) (tag :: k1). Control.Effect.RWS.RWS' new r w s m => Control.Effect.Writer.Writer' tag w (Control.Effect.RWS.Tagger tag new m) instance forall k1 k2 (new :: k2) r w s (m :: * -> *) (tag :: k1). Control.Effect.RWS.RWS' new r w s m => Control.Effect.State.State' tag s (Control.Effect.RWS.Tagger tag new m) instance forall k (tag :: k) r (m :: * -> *). Control.Effect.Reader.Reader' tag r m => Control.Effect.Reader.Reader' tag r (Control.Effect.RWS.Separation m) instance forall k (tag :: k) w (m :: * -> *). Control.Effect.Writer.Writer' tag w m => Control.Effect.Writer.Writer' tag w (Control.Effect.RWS.Separation m) instance forall k (tag :: k) s (m :: * -> *). Control.Effect.State.State' tag s m => Control.Effect.State.State' tag s (Control.Effect.RWS.Separation m) instance forall k (tag :: k) r (m :: * -> *) w s. (Control.Effect.Reader.Reader' tag r m, Control.Effect.Writer.Writer' tag w m, Control.Effect.State.State' tag s m) => Control.Effect.RWS.RWS' tag r w s (Control.Effect.RWS.Separation m) instance forall k (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: Control.Effect.Machinery.Via.SomeMonad) (tag :: k) r (effs :: [Control.Effect.Machinery.Via.Effect]) w s. (GHC.Base.Monad (t m), Control.Effect.Reader.Reader' tag r (Control.Effect.Machinery.Via.EachVia effs t m), Control.Effect.Writer.Writer' tag w (Control.Effect.Machinery.Via.EachVia effs t m), Control.Effect.State.State' tag s (Control.Effect.Machinery.Via.EachVia effs t m)) => Control.Effect.RWS.RWS' tag r w s (Control.Effect.Machinery.Via.EachVia (Control.Effect.RWS.RWS' tag r w s : effs) t m) instance forall k (tag :: k) r w s (effs :: [Control.Effect.Machinery.Via.Effect]) (t :: Control.Effect.Machinery.Via.SomeMonad -> * -> *) (m :: Control.Effect.Machinery.Via.SomeMonad) (other :: Control.Effect.Machinery.Via.Effect). Control.Effect.Machinery.Via.Find (Control.Effect.RWS.RWS' tag r w s) effs t m => Control.Effect.RWS.RWS' tag r w s (Control.Effect.Machinery.Via.EachVia (other : effs) t m) instance forall k (tag :: k) r w s (t :: Control.Effect.Machinery.Via.Transformer) (m :: Control.Effect.Machinery.Via.SomeMonad). Control.Effect.Machinery.Via.Control (Control.Effect.RWS.RWS' tag r w s) t m => Control.Effect.RWS.RWS' tag r w s (Control.Effect.Machinery.Via.EachVia '[] t m) instance forall k (m :: * -> *) w (tag :: k) r s. (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.RWS.RWS' tag r w s (Control.Monad.Trans.RWS.Lazy.RWST r w s m) instance forall k (m :: * -> *) w (tag :: k) r s. (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.RWS.RWS' tag r w s (Control.Monad.Trans.RWS.CPS.RWST r w s m) -- | Strict interpretations of the RWS' effect. -- -- If you don't require disambiguation of multiple RWS effects (i.e., you -- only have one RWS effect in your monadic context), you usually need -- the untagged interpretations. module Control.Effect.RWS.Strict -- | The strict interpreter of the RWS effect. This type implements the -- RWS' type class in a strict manner. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data RWST r w s m a -- | Runs the RWS effect and discards the final state. evalRWS' :: forall tag r w s m a. (Functor m, Monoid w) => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, a) -- | Runs the RWS effect and discards the result of the interpreted -- program. execRWS' :: forall tag r w s m a. (Functor m, Monoid w) => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, s) -- | Runs the RWS effect and returns the final output, the final state and -- the result of the interpreted program. runRWS' :: forall tag r w s m a. (Functor m, Monoid w) => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, s, a) -- | The untagged version of evalRWS'. evalRWS :: (Functor m, Monoid w) => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, a) -- | The untagged version of execRWS'. execRWS :: (Functor m, Monoid w) => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, s) -- | The untagged version of runRWS'. runRWS :: (Functor m, Monoid w) => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, s, a) instance forall k (tag :: k) r w s (m :: * -> *). GHC.Base.Monad m => Control.Effect.State.State' tag s (Control.Effect.RWS.Strict.RWST r w s m) instance forall k (tag :: k) r w s (m :: * -> *). (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.Writer.Writer' tag w (Control.Effect.RWS.Strict.RWST r w s m) instance forall k (tag :: k) r w s (m :: * -> *). GHC.Base.Monad m => Control.Effect.Reader.Reader' tag r (Control.Effect.RWS.Strict.RWST r w s m) instance forall k (tag :: k) r w s (m :: * -> *). (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.RWS.RWS' tag r w s (Control.Effect.RWS.Strict.RWST r w s m) instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.RWS.Strict.RWST r w s) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.RWS.Strict.RWST r w s m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.RWS.Strict.RWST r w s m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.RWS.Strict.RWST r w s m) instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.RWS.Strict.RWST r w s m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.RWS.Strict.RWST r w s m) instance (Control.Monad.Trans.Control.MonadBaseControl b m, GHC.Base.Monoid w) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.RWS.Strict.RWST r w s m) instance GHC.Base.Monoid w => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.RWS.Strict.RWST r w s) -- | Lazy interpretations of the RWS' effect. -- -- If you don't require disambiguation of multiple RWS effects (i.e., you -- only have one RWS effect in your monadic context), you usually need -- the untagged interpretations. module Control.Effect.RWS.Lazy -- | Runs the RWS effect and discards the final state. evalRWS' :: forall tag r w s m a. Functor m => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, a) -- | Runs the RWS effect and discards the result of the interpreted -- program. execRWS' :: forall tag r w s m a. Functor m => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, s) -- | Runs the RWS effect and returns the final output, the final state and -- the result of the interpreted program. runRWS' :: forall tag r w s m a. Functor m => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, s, a) -- | The untagged version of evalRWS'. evalRWS :: Functor m => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, a) -- | The untagged version of execRWS'. execRWS :: Functor m => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, s) -- | The untagged version of runRWS'. runRWS :: Functor m => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, s, a) -- | Lazy interpretations of the Writer' effect. -- -- If you don't require disambiguation of multiple writer effects (i.e., -- you only have one writer effect in your monadic context), you usually -- need the untagged interpretations. module Control.Effect.Writer.Lazy -- | Runs the writer effect and returns the final output. execWriter' :: forall tag w m a. Monad m => (Writer' tag w `Via` WriterT w) m a -> m w -- | Runs the writer effect and returns both the final output and the -- result of the interpreted program. runWriter' :: forall tag w m a. Functor m => (Writer' tag w `Via` WriterT w) m a -> m (w, a) -- | The untagged version of execWriter'. execWriter :: Monad m => (Writer w `Via` WriterT w) m a -> m w -- | The untagged version of runWriter'. runWriter :: Functor m => (Writer w `Via` WriterT w) m a -> m (w, a) -- | Strict interpretations of the Writer' effect. -- -- If you don't require disambiguation of multiple writer effects (i.e., -- you only have one writer effect in your monadic context), you usually -- need the untagged interpretations. module Control.Effect.Writer.Strict -- | The strict interpreter of the writer effect. This type implements the -- Writer' type class in a strict manner. -- -- When interpreting the effect, you usually don't interact with this -- type directly, but instead use one of its corresponding interpretation -- functions. data WriterT w m a -- | Runs the writer effect and returns the final output. execWriter' :: forall tag w m a. (Monad m, Monoid w) => (Writer' tag w `Via` WriterT w) m a -> m w -- | Runs the writer effect and returns both the final output and the -- result of the interpreted program. runWriter' :: forall tag w m a. (Functor m, Monoid w) => (Writer' tag w `Via` WriterT w) m a -> m (w, a) -- | The untagged version of execWriter'. execWriter :: (Monad m, Monoid w) => (Writer w `Via` WriterT w) m a -> m w -- | The untagged version of runWriter'. runWriter :: (Functor m, Monoid w) => (Writer w `Via` WriterT w) m a -> m (w, a) instance forall k (tag :: k) w (m :: * -> *). (GHC.Base.Monad m, GHC.Base.Monoid w) => Control.Effect.Writer.Writer' tag w (Control.Effect.Writer.Strict.WriterT w m) instance Control.Monad.Trans.Class.MonadTrans (Control.Effect.Writer.Strict.WriterT w) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Effect.Writer.Strict.WriterT w m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Effect.Writer.Strict.WriterT w m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Effect.Writer.Strict.WriterT w m) instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Effect.Writer.Strict.WriterT w m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Effect.Writer.Strict.WriterT w m) instance (Control.Monad.Trans.Control.MonadBaseControl b m, GHC.Base.Monoid w) => Control.Monad.Trans.Control.MonadBaseControl b (Control.Effect.Writer.Strict.WriterT w m) instance GHC.Base.Monoid w => Control.Monad.Trans.Control.MonadTransControl (Control.Effect.Writer.Strict.WriterT w)