-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A faster variant of the RWS monad transformers. -- -- This is a version of the RWS monad transformers that should be much -- faster than what's found in transformers. The writer in the strict -- version does not leak memory. @package stateWriter @version 0.4.0 module Control.Monad.Trans.RSS.Lazy -- | A monad containing an environment of type r, output of type -- w and an updatable state of type s. type RSS r w s = RSST r w s Identity -- | Construct an RSS computation from a function. (The inverse of -- runRSS.) rss :: Monoid w => (r -> s -> (a, s, w)) -> RSS r w s a -- | Unwrap an RSS computation as a function. (The inverse of rws.) runRSS :: Monoid w => RSS r w s a -> r -> s -> (a, s, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final value and output, discarding the final state. evalRSS :: Monoid w => RSS r w s a -> r -> s -> (a, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final state and output, discarding the final value. execRSS :: Monoid w => RSS r w s a -> r -> s -> (s, w) withRSS :: (r' -> s -> (r, s)) -> RSS r w s a -> RSS r' w s a -- | A monad transformer adding reading an environment of type r, -- collecting an output of type w and updating a state of type -- s to an inner monad m. data RSST r w s m a runRSST :: (Monoid w, Monad m) => RSST r w s m a -> r -> s -> m (a, s, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final value and output, discarding the final state. evalRSST :: (Monad m, Monoid w) => RSST r w s m a -> r -> s -> m (a, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final state and output, discarding the final value. execRSST :: (Monad m, Monoid w) => RSST r w s m a -> r -> s -> m (s, w) -- | withRSST f m executes action m with an -- initial environment and state modified by applying f. -- --
withRSST :: (r' -> s -> (r, s)) -> RSST r w s m a -> RSST r' w s m a -- | Lift a catchE operation to the new monad. liftCatch :: Catch e m (a, (s, w)) -> Catch e (RSST r w s m) a instance GHC.Base.Functor m => GHC.Base.Functor (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance (GHC.Base.Functor m, GHC.Base.Monad m) => GHC.Base.Applicative (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance (GHC.Base.Functor m, GHC.Base.MonadPlus m) => GHC.Base.Alternative (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance Control.Monad.Trans.Class.MonadTrans (Control.Monad.Trans.RSS.Lazy.RSST r w s) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance GHC.Base.Monad m => Control.Monad.State.Class.MonadState s (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader r (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance (GHC.Base.Monoid w, GHC.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter w (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance (GHC.Base.Monoid w, GHC.Base.Monad m) => Control.Monad.RWS.Class.MonadRWS r w s (Control.Monad.Trans.RSS.Lazy.RSST r w s m) instance (GHC.Base.Monoid w, Control.Monad.Error.Class.MonadError e m) => Control.Monad.Error.Class.MonadError e (Control.Monad.Trans.RSS.Lazy.RSST r w s m) -- | Lazy RSS monad. -- -- This is a variant of the classic "Control.Monad..RWS.Lazy" -- transformer, where the Writer part rides with the State part. module Control.Monad.RSS.Lazy -- | A monad containing an environment of type r, output of type -- w and an updatable state of type s. type RSS r w s = RSST r w s Identity -- | Construct an RSS computation from a function. (The inverse of -- runRSS.) rss :: Monoid w => (r -> s -> (a, s, w)) -> RSS r w s a -- | Unwrap an RSS computation as a function. (The inverse of rws.) runRSS :: Monoid w => RSS r w s a -> r -> s -> (a, s, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final value and output, discarding the final state. evalRSS :: Monoid w => RSS r w s a -> r -> s -> (a, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final state and output, discarding the final value. execRSS :: Monoid w => RSS r w s a -> r -> s -> (s, w) withRSS :: (r' -> s -> (r, s)) -> RSS r w s a -> RSS r' w s a -- | A monad transformer adding reading an environment of type r, -- collecting an output of type w and updating a state of type -- s to an inner monad m. data RSST r w s m a runRSST :: (Monoid w, Monad m) => RSST r w s m a -> r -> s -> m (a, s, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final value and output, discarding the final state. evalRSST :: (Monad m, Monoid w) => RSST r w s m a -> r -> s -> m (a, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final state and output, discarding the final value. execRSST :: (Monad m, Monoid w) => RSST r w s m a -> r -> s -> m (s, w) -- | withRSST f m executes action m with an -- initial environment and state modified by applying f. -- -- withRSST :: (r' -> s -> (r, s)) -> RSST r w s m a -> RSST r' w s m a module Control.Monad.Trans.RSS.Strict -- | A monad containing an environment of type r, output of type -- w and an updatable state of type s. type RSS r w s = RSST r w s Identity -- | Construct an RSS computation from a function. (The inverse of -- runRSS.) rss :: Monoid w => (r -> s -> (a, s, w)) -> RSS r w s a -- | Unwrap an RSS computation as a function. (The inverse of rss.) runRSS :: Monoid w => RSS r w s a -> r -> s -> (a, s, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final value and output, discarding the final state. evalRSS :: Monoid w => RSS r w s a -> r -> s -> (a, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final state and output, discarding the final value. execRSS :: Monoid w => RSS r w s a -> r -> s -> (s, w) withRSS :: (r' -> s -> (r, s)) -> RSS r w s a -> RSS r' w s a -- | A monad transformer adding reading an environment of type r, -- collecting an output of type w and updating a state of type -- s to an inner monad m. data RSST r w s m a runRSST :: (Monoid w, Monad m) => RSST r w s m a -> r -> s -> m (a, s, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final value and output, discarding the final state. evalRSST :: (Monoid w, Monad m) => RSST r w s m a -> r -> s -> m (a, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final state and output, discarding the final value. execRSST :: (Monoid w, Monad m) => RSST r w s m a -> r -> s -> m (s, w) -- | withRSST f m executes action m with an -- initial environment and state modified by applying f. -- -- withRSST :: (r' -> s -> (r, s)) -> RSST r w s m a -> RSST r' w s m a -- | Lift a catchE operation to the new monad. liftCatch :: Catch e m (a, (s, w)) -> Catch e (RSST r w s m) a instance GHC.Base.Functor m => GHC.Base.Functor (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance GHC.Base.Monad m => GHC.Base.Monad (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance (GHC.Base.Functor m, GHC.Base.Monad m) => GHC.Base.Applicative (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance (GHC.Base.Functor m, GHC.Base.MonadPlus m) => GHC.Base.Alternative (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance Control.Monad.Trans.Class.MonadTrans (Control.Monad.Trans.RSS.Strict.RSST r w s) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance GHC.Base.Monad m => Control.Monad.State.Class.MonadState s (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader r (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance (GHC.Base.Monoid w, GHC.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter w (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance (GHC.Base.Monoid w, GHC.Base.Monad m) => Control.Monad.RWS.Class.MonadRWS r w s (Control.Monad.Trans.RSS.Strict.RSST r w s m) instance (GHC.Base.Monoid w, Control.Monad.Error.Class.MonadError e m) => Control.Monad.Error.Class.MonadError e (Control.Monad.Trans.RSS.Strict.RSST r w s m) module Control.Monad.Trans.RSS -- | Strict RSS monad. -- -- This is a variant of the classic "Control.Monad..RWS.Strict" -- transformer, where the Writer part rides with the State part. module Control.Monad.RSS.Strict -- | A monad containing an environment of type r, output of type -- w and an updatable state of type s. type RSS r w s = RSST r w s Identity -- | Construct an RSS computation from a function. (The inverse of -- runRSS.) rss :: Monoid w => (r -> s -> (a, s, w)) -> RSS r w s a -- | Unwrap an RSS computation as a function. (The inverse of rss.) runRSS :: Monoid w => RSS r w s a -> r -> s -> (a, s, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final value and output, discarding the final state. evalRSS :: Monoid w => RSS r w s a -> r -> s -> (a, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final state and output, discarding the final value. execRSS :: Monoid w => RSS r w s a -> r -> s -> (s, w) withRSS :: (r' -> s -> (r, s)) -> RSS r w s a -> RSS r' w s a -- | A monad transformer adding reading an environment of type r, -- collecting an output of type w and updating a state of type -- s to an inner monad m. data RSST r w s m a runRSST :: (Monoid w, Monad m) => RSST r w s m a -> r -> s -> m (a, s, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final value and output, discarding the final state. evalRSST :: (Monoid w, Monad m) => RSST r w s m a -> r -> s -> m (a, w) -- | Evaluate a computation with the given initial state and environment, -- returning the final state and output, discarding the final value. execRSST :: (Monoid w, Monad m) => RSST r w s m a -> r -> s -> m (s, w) -- | withRSST f m executes action m with an -- initial environment and state modified by applying f. -- -- withRSST :: (r' -> s -> (r, s)) -> RSST r w s m a -> RSST r' w s m a module Control.Monad.RSS