transformers 0.0.0.0 → 0.0.1.0
raw patch · 9 files changed
+33/−1 lines, 9 files
Files
- Control/Monad/Trans/Cont.hs +4/−0
- Control/Monad/Trans/RWS/Lazy.hs +4/−0
- Control/Monad/Trans/RWS/Strict.hs +4/−0
- Control/Monad/Trans/Reader.hs +4/−0
- Control/Monad/Trans/State/Lazy.hs +4/−0
- Control/Monad/Trans/State/Strict.hs +4/−0
- Control/Monad/Trans/Writer/Lazy.hs +4/−0
- Control/Monad/Trans/Writer/Strict.hs +4/−0
- transformers.cabal +1/−1
Control/Monad/Trans/Cont.hs view
@@ -15,6 +15,7 @@ module Control.Monad.Trans.Cont ( -- * The Cont monad Cont,+ cont, runCont, mapCont, withCont,@@ -42,6 +43,9 @@ The @>>=@ operator adds the bound function into the continuation chain. -} type Cont r = ContT r Identity++cont :: ((a -> r) -> r) -> Cont r a+cont f = ContT (\ k -> Identity (f (runIdentity . k))) -- | Runs a CPS computation, returns its result after applying the final -- continuation to it.
Control/Monad/Trans/RWS/Lazy.hs view
@@ -21,6 +21,7 @@ module Control.Monad.Trans.RWS.Lazy ( -- * The RWS monad RWS,+ rws, runRWS, evalRWS, execRWS,@@ -59,6 +60,9 @@ import Data.Monoid type RWS r w s = RWST r w s Identity++rws :: (r -> s -> (a, s, w)) -> RWS r w s a+rws f = RWST (\ r s -> Identity (f r s)) runRWS :: RWS r w s a -> r -> s -> (a, s, w) runRWS m r s = runIdentity (runRWST m r s)
Control/Monad/Trans/RWS/Strict.hs view
@@ -21,6 +21,7 @@ module Control.Monad.Trans.RWS.Strict ( -- * The RWS monad RWS,+ rws, runRWS, evalRWS, execRWS,@@ -59,6 +60,9 @@ import Data.Monoid type RWS r w s = RWST r w s Identity++rws :: (r -> s -> (a, s, w)) -> RWS r w s a+rws f = RWST (\ r s -> Identity (f r s)) runRWS :: RWS r w s a -> r -> s -> (a, s, w) runRWS m r s = runIdentity (runRWST m r s)
Control/Monad/Trans/Reader.hs view
@@ -21,6 +21,7 @@ module Control.Monad.Trans.Reader ( -- * The Reader monad Reader,+ reader, runReader, mapReader, withReader,@@ -53,6 +54,9 @@ -- environment to extract the value its left-hand side, and then applies -- the bound function to that value in the same environment. type Reader r = ReaderT r Identity++reader :: (r -> a) -> Reader r a+reader f = ReaderT (Identity . f) -- | Runs @Reader@ and extracts the final value from it. runReader :: Reader r a -- ^ A @Reader@ to run.
Control/Monad/Trans/State/Lazy.hs view
@@ -24,6 +24,7 @@ module Control.Monad.Trans.State.Lazy ( -- * The State monad State,+ state, runState, evalState, execState,@@ -60,6 +61,9 @@ runState :: State s a -> s -> (a, s) runState m = runIdentity . runStateT m++state :: (s -> (a, s)) -> State s a+state f = StateT (Identity . f) -- |Evaluate this state monad with the given initial state,throwing -- away the final state. Very much like @fst@ composed with
Control/Monad/Trans/State/Strict.hs view
@@ -24,6 +24,7 @@ module Control.Monad.Trans.State.Strict ( -- * The State monad State,+ state, runState, evalState, execState,@@ -57,6 +58,9 @@ -- to carry and /a/ is the type of the /return value/. type State s = StateT s Identity++state :: (s -> (a, s)) -> State s a+state f = StateT (Identity . f) runState :: State s a -> s -> (a, s) runState m = runIdentity . runStateT m
Control/Monad/Trans/Writer/Lazy.hs view
@@ -21,6 +21,7 @@ module Control.Monad.Trans.Writer.Lazy ( -- * The Writer monad Writer,+ writer, runWriter, execWriter, mapWriter,@@ -49,6 +50,9 @@ -- Our parameterizable writer monad type Writer w = WriterT w Identity++writer :: (a, w) -> Writer w a+writer = WriterT . Identity runWriter :: Writer w a -> (a, w) runWriter = runIdentity . runWriterT
Control/Monad/Trans/Writer/Strict.hs view
@@ -21,6 +21,7 @@ module Control.Monad.Trans.Writer.Strict ( -- * The Writer monad Writer,+ writer, runWriter, execWriter, mapWriter,@@ -49,6 +50,9 @@ -- Our parameterizable writer monad type Writer w = WriterT w Identity++writer :: (a, w) -> Writer w a+writer = WriterT . Identity runWriter :: Writer w a -> (a, w) runWriter = runIdentity . runWriterT
transformers.cabal view
@@ -1,5 +1,5 @@ name: transformers-version: 0.0.0.0+version: 0.0.1.0 license: BSD3 license-file: LICENSE author: Andy Gill