transformers 0.1.1.0 → 0.1.3.0
raw patch · 16 files changed
+370/−133 lines, 16 files
Files
- Control/Monad/Identity.hs +0/−6
- Control/Monad/Trans.hs +105/−11
- Control/Monad/Trans/Error.hs +10/−5
- Control/Monad/Trans/Identity.hs +81/−0
- Control/Monad/Trans/Maybe.hs +86/−0
- Control/Monad/Trans/RWS.hs +3/−8
- Control/Monad/Trans/RWS/Lazy.hs +1/−7
- Control/Monad/Trans/RWS/Strict.hs +0/−6
- Control/Monad/Trans/Reader.hs +72/−46
- Control/Monad/Trans/State.hs +2/−7
- Control/Monad/Trans/State/Lazy.hs +0/−7
- Control/Monad/Trans/State/Strict.hs +0/−7
- Control/Monad/Trans/Writer.hs +2/−7
- Control/Monad/Trans/Writer/Lazy.hs +0/−6
- Control/Monad/Trans/Writer/Strict.hs +0/−6
- transformers.cabal +8/−4
Control/Monad/Identity.hs view
@@ -30,12 +30,6 @@ of monad transformers. Any monad transformer applied to the @Identity@ monad yields a non-transformer version of that monad.-- Inspired by the paper- /Functional Programming with Overloading and- Higher-Order Polymorphism/,- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)- Advanced School of Functional Programming, 1995. -} module Control.Monad.Identity (
Control/Monad/Trans.hs view
@@ -9,34 +9,128 @@ -- Stability : experimental -- Portability : portable ----- The MonadTrans class.+-- Classes for monad transformers. ----- Inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)--- Advanced School of Functional Programming, 1995.+-- A monad transformer makes new monad out of an existing monad, such+-- that computations of the old monad may be embedded in the new one.+-- To construct a monad with a desired set of features, one typically+-- starts with a base monad, such as @Identity@, @[]@ or 'IO', and+-- applies a sequence of monad transformers.+--+-- Most monad transformer modules include the special case of applying the+-- transformer to @Identity@. For example, @State s@ is an abbreviation+-- for @StateT s Identity@.+--+-- Each monad transformer also comes with an operation @run@/XXX/ to+-- unwrap the transformer, exposing a computation of the inner monad. ----------------------------------------------------------------------------- module Control.Monad.Trans (+ -- * Transformer classes MonadTrans(..), MonadIO(..),++ -- * Examples+ -- ** Parsing+ -- $example1++ -- ** Parsing and counting+ -- $example2 ) where import System.IO --- ------------------------------------------------------------------------------ MonadTrans class+-- | The class of monad transformers. Instances should satisfy the laws ----- Monad to facilitate stackable Monads.--- Provides a way of digging into an outer--- monad, giving access to (lifting) the inner monad.+-- * @'lift' . 'return' = 'return'@+--+-- * @'lift' (m >>= f) = 'lift' m >>= ('lift' . f)@ class MonadTrans t where+ -- | Lift a computation from the argument monad to the constructed monad. lift :: Monad m => m a -> t m a +-- | Monads in which 'IO' computations may be embedded.+-- Any monad built by applying a sequence of monad transformers to the+-- 'IO' monad will be an instance of this class. class (Monad m) => MonadIO m where+ -- | Lift a computation from the 'IO' monad. liftIO :: IO a -> m a instance MonadIO IO where liftIO = id++{- $example1++One might define a parsing monad by adding a state, consisting of the+'String' remaining to be parsed, to the @[]@ monad, which provides+non-determinism:++> import Control.Monad.Trans.State+>+> type Parser = StateT String []++Then @Parser@ is an instance of @MonadPlus@: monadic sequencing implements+concatenation of parsers, while @mplus@ provides choice.+To use parsers, we need a primitive to run a constructed parser on an+input string:++> runParser :: Parser a -> String -> [a]+> runParser p s = [x | (x, "") <- runStateT p s]++Finally, we need a primitive parser that matches a single character,+from which arbitrarily complex parsers may be constructed:++> item :: Parser Char+> item = do+> c:cs <- get+> put cs+> return c++In this example we use the operations @get@ and @put@ from+"Control.Monad.Trans.State", which are defined only for monads that are+applications of @StateT@. Alternatively one could use monad classes+from other packages, which contain methods @get@ and @put@ with types+generalized over all suitable monads.+-}++{- $example2++We can define a parser that also counts by adding a @WriterT@ transformer:++> import Control.Monad.Trans+> import Control.Monad.Trans.State+> import Control.Monad.Trans.Writer+> import Data.Monoid+>+> type Parser = WriterT (Sum Int) (StateT String [])++The function that applies a parser must now unwrap each of the monad+transformers in turn:++> runParser :: Parser a -> String -> [(a, Int)]+> runParser p s = [(x, n) | ((x, Sum n), "") <- runStateT (runWriterT p) s]++To define @item@ parser, we need to lift the @StateT@ operations through+the @WriterT@ transformers.++> item :: Parser Char+> item = do+> c:cs <- lift get+> lift (put cs)+> return c++In this case, we were able to do this with 'lift', but operations with+more complex types require special lifting functions, which are provided+by monad transformers for which they can be implemented. If you use+one of packages of monad classes, this lifting is handled automatically+by the instances of the classes, and you need only use the generalized+methods @get@ and @put@.++We can also define a primitive using the Writer:++> tick :: Parser ()+> tick = tell (Sum 1)++Then the parser will keep track of how many @tick@s it executes.+-}
Control/Monad/Trans/Error.hs view
@@ -26,11 +26,6 @@ The Error monad (also called the Exception monad). -} -{-- Rendered by Michael Weber <mailto:michael.weber@post.rwth-aachen.de>,- inspired by the Haskell Monad Template Library from- Andy Gill (<http://web.cecs.pdx.edu/~andy/>)--} module Control.Monad.Trans.Error ( -- * The ErrorT monad transformer Error(..),@@ -87,6 +82,16 @@ -- --------------------------------------------------------------------------- -- Our parameterizable error monad++instance Applicative (Either e) where+ pure = Right+ Left e <*> _ = Left e+ Right f <*> r = fmap f r++instance (Error e) => Alternative (Either e) where+ empty = Left noMsg+ Left _ <|> n = n+ m <|> _ = m instance (Error e) => Monad (Either e) where return = Right
+ Control/Monad/Trans/Identity.hs view
@@ -0,0 +1,81 @@+-----------------------------------------------------------------------------+-- |+-- Module : Control.Monad.Trans.Identity+-- Copyright : (c) 2007 Magnus Therning+-- License : BSD-style (see the file LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : experimental+-- Portability : portable+--+-- Declaration of the identity monad transformer.+-----------------------------------------------------------------------------++module Control.Monad.Trans.Identity (+ -- * The identity monad transformer+ IdentityT(..),+ -- * Lifting other operations+ liftCallCC,+ liftCatch,+ liftListen,+ liftLocal,+ liftPass,+ ) where++import Control.Applicative+import Control.Monad (MonadPlus(mzero, mplus), liftM, ap)+import Control.Monad.Trans (MonadIO(liftIO), MonadTrans(lift))++newtype IdentityT m a = IdentityT { runIdentityT :: m a }++instance (Functor m) => Functor (IdentityT m) where+ fmap f = IdentityT . fmap f . runIdentityT++instance (Applicative m) => Applicative (IdentityT m) where+ pure x = IdentityT (pure x)+ f <*> v = IdentityT (runIdentityT f <*> runIdentityT v)+ +instance (Alternative m) => Alternative (IdentityT m) where+ empty = IdentityT empty+ f <|> v = IdentityT (runIdentityT f <|> runIdentityT v)++instance (Monad m) => Monad (IdentityT m) where+ return = IdentityT . return+ m >>= k = IdentityT $ runIdentityT . k =<< runIdentityT m+ fail msg = IdentityT $ fail msg+ +instance (MonadPlus m) => MonadPlus (IdentityT m) where+ mzero = IdentityT mzero+ f `mplus` v = IdentityT (runIdentityT f `mplus` runIdentityT v)++instance (MonadIO m) => MonadIO (IdentityT m) where+ liftIO = IdentityT . liftIO++instance MonadTrans IdentityT where+ lift = IdentityT++-- | Lift a @callCC@ operation to the new monad.+liftCallCC :: (((a -> m b) -> m a) ->+ m a) -> ((a -> IdentityT m b) -> IdentityT m a) -> IdentityT m a+liftCallCC callCC f =+ IdentityT $ callCC $ \ c -> runIdentityT (f (IdentityT . c))++-- | Lift a @catchError@ operation to the new monad.+liftCatch :: (m a -> (e -> m a) -> m a) ->+ IdentityT m a -> (e -> IdentityT m a) -> IdentityT m a+liftCatch f m h = IdentityT $ f (runIdentityT m) (runIdentityT . h)++-- | Lift a @listen@ operation to the new monad.+liftListen :: Monad m =>+ (m a -> m (a,w)) -> IdentityT m a -> IdentityT m (a,w)+liftListen listen = IdentityT . listen . runIdentityT++-- | Lift a @local@ operation to the new monad.+liftLocal :: Monad m => ((r -> r) -> m a -> m a) ->+ (r -> r) -> IdentityT m a -> IdentityT m a+liftLocal local f = IdentityT . local f . runIdentityT++-- | Lift a @pass@ operation to the new monad.+liftPass :: Monad m => (m (a,w -> w) -> m a) ->+ IdentityT m (a,w -> w) -> IdentityT m a+liftPass pass = IdentityT . pass . runIdentityT
+ Control/Monad/Trans/Maybe.hs view
@@ -0,0 +1,86 @@+-----------------------------------------------------------------------------+-- |+-- Module : Control.Monad.Trans.Maybe+-- Copyright : (c) 2007 Yitzak Gale, Eric Kidd+-- License : BSD-style (see the file LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : experimental+-- Portability : portable+--+-- Declaration of the 'MaybeT' monad transformer.+-----------------------------------------------------------------------------++module Control.Monad.Trans.Maybe (+ -- * The MaybeT monad transformer+ MaybeT(..),+ -- * Lifting other operations+ liftCallCC,+ liftListen,+ liftPass,+ ) where++import Control.Applicative+import Control.Monad (MonadPlus(mzero, mplus), liftM, ap)+import Control.Monad.Trans (MonadIO(liftIO), MonadTrans(lift))++newtype MaybeT m a = MaybeT { runMaybeT :: m (Maybe a) }++mapMaybeT :: (m (Maybe a) -> n (Maybe b)) -> MaybeT m a -> MaybeT n b+mapMaybeT f = MaybeT . f . runMaybeT++instance (Functor m) => Functor (MaybeT m) where+ fmap f = mapMaybeT (fmap (fmap f))++instance (Functor m, Monad m) => Applicative (MaybeT m) where+ pure = return+ (<*>) = ap+ +instance (Functor m, Monad m) => Alternative (MaybeT m) where+ empty = mzero+ (<|>) = mplus++instance (Monad m) => Monad (MaybeT m) where+ fail _ = MaybeT (return Nothing)+ return = lift . return+ x >>= f = MaybeT $ do+ v <- runMaybeT x+ case v of+ Nothing -> return Nothing+ Just y -> runMaybeT (f y)++instance (Monad m) => MonadPlus (MaybeT m) where+ mzero = MaybeT (return Nothing)+ mplus x y = MaybeT $ do+ v <- runMaybeT x+ case v of+ Nothing -> runMaybeT y+ Just _ -> return v++instance MonadTrans MaybeT where+ lift = MaybeT . liftM Just++instance (MonadIO m) => MonadIO (MaybeT m) where+ liftIO = lift . liftIO++-- | Lift a @callCC@ operation to the new monad.+liftCallCC :: (((Maybe a -> m (Maybe b)) -> m (Maybe a)) ->+ m (Maybe a)) -> ((a -> MaybeT m b) -> MaybeT m a) -> MaybeT m a+liftCallCC callCC f =+ MaybeT $ callCC $ \ c -> runMaybeT (f (MaybeT . c . Just))++-- | Lift a @listen@ operation to the new monad.+liftListen :: Monad m =>+ (m (Maybe a) -> m (Maybe a,w)) -> MaybeT m a -> MaybeT m (a,w)+liftListen listen = mapMaybeT $ \ m -> do+ (a, w) <- listen m+ return $! fmap (\ r -> (r, w)) a++-- | Lift a @pass@ operation to the new monad.+liftPass :: Monad m => (m (Maybe a,w -> w) -> m (Maybe a)) ->+ MaybeT m (a,w -> w) -> MaybeT m a+liftPass pass = mapMaybeT $ \ m -> pass $ do+ a <- m+ return $! case a of+ Nothing -> (Nothing, id)+ Just (v, f) -> (Just v, f)
Control/Monad/Trans/RWS.hs view
@@ -9,13 +9,9 @@ -- Stability : experimental -- Portability : portable ----- Combination Reader, Writer and State monad transformer.------ Inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)--- Advanced School of Functional Programming, 1995.+-- A monad transformer that combines 'ReaderT', 'WriterT' and 'State'.+-- This version is lazy; for a strict version, see+-- "Control.Monad.Trans.RWS.Strict", which has the same interface. ----------------------------------------------------------------------------- module Control.Monad.Trans.RWS (@@ -23,4 +19,3 @@ ) where import Control.Monad.Trans.RWS.Lazy-
Control/Monad/Trans/RWS/Lazy.hs view
@@ -10,12 +10,6 @@ -- Portability : portable -- -- Lazy RWS monad.------ Inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)--- Advanced School of Functional Programming, 1995. ----------------------------------------------------------------------------- module Control.Monad.Trans.RWS.Lazy (@@ -108,7 +102,7 @@ instance (Functor m) => Functor (RWST r w s m) where fmap f m = RWST $ \r s ->- fmap (\ ~(a, s', w) -> (f a, s', w)) $ runRWST m r s + fmap (\ ~(a, s', w) -> (f a, s', w)) $ runRWST m r s instance (Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) where pure = return
Control/Monad/Trans/RWS/Strict.hs view
@@ -10,12 +10,6 @@ -- Portability : portable -- -- Strict RWS monad.------ Inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)--- Advanced School of Functional Programming, 1995. ----------------------------------------------------------------------------- module Control.Monad.Trans.RWS.Strict (
Control/Monad/Trans/Reader.hs view
@@ -3,19 +3,14 @@ -- Module : Control.Monad.Trans.Reader -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science and Technology, 2001--- License : BSD-style (see the file libraries/base/LICENSE)+-- License : BSD-style (see the file LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : experimental -- Portability : portable ----- Declaration of the MonadReader class------ Inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)--- Advanced School of Functional Programming, 1995.+-- Declaration of the 'ReaderT' monad transformer, which adds a static+-- environment to a given monad. ----------------------------------------------------------------------------- module Control.Monad.Trans.Reader (@@ -48,90 +43,121 @@ -- | The parameterizable reader monad. ----- The 'return' function creates a @Reader@ that ignores the environment,--- and produces the given value.+-- Computations are functions of a shared environment. ----- The binding operator @>>=@ produces a @Reader@ that uses the--- environment to extract the value its left-hand side, and then applies--- the bound function to that value in the same environment.+-- The 'return' function ignores the environment, while @>>=@ passes+-- the inherited environment to both subcomputations. type Reader r = ReaderT r Identity +-- | Constructor for computations in the reader monad. reader :: (r -> a) -> Reader r a reader f = ReaderT (Identity . f) --- | Runs @Reader@ and extracts the final value from it.+-- | Runs a @Reader@ and extracts the final value from it. runReader :: Reader r a -- ^ A @Reader@ to run. -> r -- ^ An initial environment. -> a runReader m = runIdentity . runReaderT m +-- | Transform the value returned by a @Reader@. mapReader :: (a -> b) -> Reader r a -> Reader r b mapReader f = mapReaderT (Identity . f . runIdentity) --- | A more general version of 'local'.-withReader :: (r' -> r) -> Reader r a -> Reader r' a+-- | Execute a computation in a modified environment+-- (a specialization of 'withReaderT').+withReader+ :: (r' -> r) -- ^ The function to modify the environment.+ -> Reader r a -- ^ Computation to run in the modified environment.+ -> Reader r' a withReader = withReaderT --- | The reader monad transformer.--- Can be used to add environment reading functionality to other monads.-newtype ReaderT r m a = ReaderT { runReaderT :: r -> m a }+-- | The reader monad transformer,+-- which adds a read-only environment to the given monad.+--+-- The 'return' function ignores the environment, while @>>=@ passes+-- the inherited environment to both subcomputations.+newtype ReaderT r m a = ReaderT {+ -- | The underlying computation, as a function of the environment.+ runReaderT :: r -> m a+ } -mapReaderT :: (m a -> n b) -> ReaderT w m a -> ReaderT w n b+-- | Transform the computation inside a @ReaderT@.+mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b mapReaderT f m = ReaderT $ f . runReaderT m -withReaderT :: (r' -> r) -> ReaderT r m a -> ReaderT r' m a+-- | Execute a computation in a modified environment+-- (a more general version of 'local').+withReaderT+ :: (r' -> r) -- ^ The function to modify the environment.+ -> ReaderT r m a -- ^ Computation to run in the modified environment.+ -> ReaderT r' m a withReaderT f m = ReaderT $ runReaderT m . f instance (Functor m) => Functor (ReaderT r m) where- fmap f m = ReaderT (fmap f . runReaderT m)+ fmap f = mapReaderT (fmap f) instance (Applicative m) => Applicative (ReaderT r m) where- pure a = ReaderT $ \ _ -> pure a+ pure = liftReaderT . pure f <*> v = ReaderT $ \ r -> runReaderT f r <*> runReaderT v r instance (Alternative m) => Alternative (ReaderT r m) where- empty = ReaderT $ \_ -> empty- m <|> n = ReaderT $ \r -> runReaderT m r <|> runReaderT n r+ empty = liftReaderT empty+ m <|> n = ReaderT $ \ r -> runReaderT m r <|> runReaderT n r instance (Monad m) => Monad (ReaderT r m) where- return a = ReaderT $ \_ -> return a- m >>= k = ReaderT $ \r -> do+ return = lift . return+ m >>= k = ReaderT $ \ r -> do a <- runReaderT m r runReaderT (k a) r- fail msg = ReaderT $ \_ -> fail msg+ fail msg = lift (fail msg) instance (MonadPlus m) => MonadPlus (ReaderT r m) where- mzero = ReaderT $ \_ -> mzero- m `mplus` n = ReaderT $ \r -> runReaderT m r `mplus` runReaderT n r+ mzero = lift mzero+ m `mplus` n = ReaderT $ \ r -> runReaderT m r `mplus` runReaderT n r instance (MonadFix m) => MonadFix (ReaderT r m) where- mfix f = ReaderT $ \r -> mfix $ \a -> runReaderT (f a) r+ mfix f = ReaderT $ \ r -> mfix $ \ a -> runReaderT (f a) r instance MonadTrans (ReaderT r) where- lift m = ReaderT $ \_ -> m+ lift = liftReaderT instance (MonadIO m) => MonadIO (ReaderT r m) where liftIO = lift . liftIO +liftReaderT :: m a -> ReaderT r m a+liftReaderT m = ReaderT (const m)++-- | Fetch the value of the environment. ask :: (Monad m) => ReaderT r m r ask = ReaderT return -local :: (Monad m) => (r -> r) -> ReaderT r m a -> ReaderT r m a-local f m = ReaderT $ \r -> runReaderT m (f r)+-- | Execute a computation in a modified environment+-- (a specialization of 'withReaderT').+local :: (Monad m)+ => (r -> r) -- ^ The function to modify the environment.+ -> ReaderT r m a -- ^ Computation to run in the modified environment.+ -> ReaderT r m a+local = withReaderT -asks :: (Monad m) => (r -> a) -> ReaderT r m a-asks f = do- r <- ask- return (f r)+-- | Retrieve a function of the current environment.+asks :: (Monad m)+ => (r -> a) -- ^ The selector function to apply to the environment.+ -> ReaderT r m a+asks f = liftM f ask -- | Lift a @callCC@ operation to the new monad.-liftCallCC :: (((a -> m b) -> m a) -> m a) ->- ((a -> ReaderT r m b) -> ReaderT r m a) -> ReaderT r m a-liftCallCC callCC f = ReaderT $ \r ->- callCC $ \c ->- runReaderT (f (\a -> ReaderT $ \_ -> c a)) r+liftCallCC ::+ (((a -> m b) -> m a) -> m a) -- ^ @callCC@ on the argument monad.+ -> ((a -> ReaderT r m b) -> ReaderT r m a) -> ReaderT r m a+liftCallCC callCC f = ReaderT $ \ r ->+ callCC $ \ c ->+ runReaderT (f (ReaderT . const . c)) r -- | Lift a @catchError@ operation to the new monad.-liftCatch :: (m a -> (e -> m a) -> m a) ->- ReaderT r m a -> (e -> ReaderT r m a) -> ReaderT r m a-liftCatch f m h = ReaderT $ \r -> f (runReaderT m r) (\e -> runReaderT (h e) r)+liftCatch ::+ (m a -> (e -> m a) -> m a) -- ^ @catch@ on the argument monad.+ -> ReaderT r m a -- ^ Computation to attempt.+ -> (e -> ReaderT r m a) -- ^ Exception handler.+ -> ReaderT r m a+liftCatch f m h =+ ReaderT $ \ r -> f (runReaderT m r) (\ e -> runReaderT (h e) r)
Control/Monad/Trans/State.hs view
@@ -10,13 +10,8 @@ -- Portability : portable -- -- State monads.------ This module is inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)--- Advanced School of Functional Programming, 1995.-+-- This version is lazy; for a strict version, see+-- "Control.Monad.Trans.State.Strict", which has the same interface. ----------------------------------------------------------------------------- module Control.Monad.Trans.State (
Control/Monad/Trans/State/Lazy.hs view
@@ -11,14 +11,7 @@ -- -- Lazy state monads. ----- This module is inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)--- Advanced School of Functional Programming, 1995.--- -- See below for examples.- ----------------------------------------------------------------------------- module Control.Monad.Trans.State.Lazy (
Control/Monad/Trans/State/Strict.hs view
@@ -11,14 +11,7 @@ -- -- Strict state monads. ----- This module is inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/>)--- Advanced School of Functional Programming, 1995.--- -- See below for examples.- ----------------------------------------------------------------------------- module Control.Monad.Trans.State.Strict (
Control/Monad/Trans/Writer.hs view
@@ -10,12 +10,8 @@ -- Portability : portable -- -- The WriterT monad transformer.------ Inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>)--- Advanced School of Functional Programming, 1995.+-- This version is lazy; for a strict version, see+-- "Control.Monad.Trans.Writer.Strict", which has the same interface. ----------------------------------------------------------------------------- module Control.Monad.Trans.Writer (@@ -23,4 +19,3 @@ ) where import Control.Monad.Trans.Writer.Lazy-
Control/Monad/Trans/Writer/Lazy.hs view
@@ -10,12 +10,6 @@ -- Portability : portable -- -- Lazy writer monads.------ Inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>)--- Advanced School of Functional Programming, 1995. ----------------------------------------------------------------------------- module Control.Monad.Trans.Writer.Lazy (
Control/Monad/Trans/Writer/Strict.hs view
@@ -10,12 +10,6 @@ -- Portability : portable -- -- Strict writer monads.------ Inspired by the paper--- /Functional Programming with Overloading and--- Higher-Order Polymorphism/,--- Mark P Jones (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>)--- Advanced School of Functional Programming, 1995. ----------------------------------------------------------------------------- module Control.Monad.Trans.Writer.Strict (
transformers.cabal view
@@ -1,5 +1,5 @@ name: transformers-version: 0.1.1.0+version: 0.1.3.0 license: BSD3 license-file: LICENSE author: Andy Gill@@ -8,14 +8,15 @@ synopsis: Concrete monad transformers description: Haskell 98 part of a monad transformer library, inspired by the paper- /Functional Programming with Overloading and Higher-Order Polymorphism/,+ \"Functional Programming with Overloading and Higher-Order Polymorphism\", by Mark P Jones, in /Advanced School of Functional Programming/, 1995 (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>). . This part contains the monad transformer class, the concrete monad transformers, operations and liftings. It can be used on its own- in Haskell 98 code, or with the monad classes in the packages- @monads-fd@ or @monads-tf@.+ in Haskell 98 code, or with the monad classes in the @monads-fd@ or+ @monads-tf@ packages, which automatically lift operations introduced+ by monad transformers through other transformers. build-type: Simple cabal-version: >= 1.2 @@ -33,7 +34,9 @@ Control.Monad.Trans Control.Monad.Trans.Cont Control.Monad.Trans.Error+ Control.Monad.Trans.Identity Control.Monad.Trans.List+ Control.Monad.Trans.Maybe Control.Monad.Trans.Reader Control.Monad.Trans.RWS Control.Monad.Trans.RWS.Lazy@@ -44,3 +47,4 @@ Control.Monad.Trans.Writer Control.Monad.Trans.Writer.Lazy Control.Monad.Trans.Writer.Strict+ extensions: CPP