mtl 1.1.0.2 → 1.1.1.0
raw patch · 20 files changed
+71/−84 lines, 20 filesdep ~base
Dependency ranges changed: base
Files
- Control/Monad/Cont.hs +4/−4
- Control/Monad/Cont/Class.hs +2/−2
- Control/Monad/Error.hs +24/−13
- Control/Monad/Error/Class.hs +1/−1
- Control/Monad/List.hs +1/−1
- Control/Monad/RWS/Lazy.hs +2/−2
- Control/Monad/RWS/Strict.hs +2/−2
- Control/Monad/Reader.hs +3/−11
- Control/Monad/Reader/Class.hs +10/−1
- Control/Monad/State/Lazy.hs +4/−4
- Control/Monad/State/Strict.hs +4/−4
- Control/Monad/Trans.hs +0/−2
- Control/Monad/Writer.hs +2/−2
- Control/Monad/Writer/Class.hs +2/−2
- Control/Monad/Writer/Lazy.hs +4/−4
- Control/Monad/Writer/Strict.hs +4/−4
- Makefile.inc +0/−7
- Makefile.nhc98 +0/−12
- mtl.cabal +2/−2
- prologue.txt +0/−4
Control/Monad/Cont.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS -fallow-undecidable-instances #-}--- Search for -fallow-undecidable-instances to see why this is needed+{-# LANGUAGE UndecidableInstances #-}+-- Search for UndecidableInstances to see why this is needed {- | Module : Control.Monad.Cont@@ -146,14 +146,14 @@ instance (MonadIO m) => MonadIO (ContT r m) where liftIO = lift . liftIO --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (MonadReader r' m) => MonadReader r' (ContT r m) where ask = lift ask local f m = ContT $ \c -> do r <- ask local f (runContT m (local (const r) . c)) --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (MonadState s m) => MonadState s (ContT r m) where get = lift get put = lift . put
Control/Monad/Cont/Class.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS -fallow-undecidable-instances #-}--- Search for -fallow-undecidable-instances to see why this is needed+{-# LANGUAGE UndecidableInstances #-}+-- Search for UndecidableInstances to see why this is needed {- | Module : Control.Monad.Cont.Class
Control/Monad/Error.hs view
@@ -1,6 +1,9 @@-{-# OPTIONS -fallow-undecidable-instances #-}-{-# OPTIONS_GHC -fno-warn-orphans #-} -- Temporary, I hope. SLPJ Aug08--- Needed for the same reasons as in Reader, State etc+-- Undecidable instances needed for the same reasons as in Reader, State etc:+{-# LANGUAGE UndecidableInstances #-}+-- De-orphaning this module is tricky:+{-# OPTIONS_GHC -fno-warn-orphans #-}+-- To handle instances moved to base:+{-# LANGUAGE CPP #-} {- | Module : Control.Monad.Error@@ -53,15 +56,18 @@ import Control.Monad.Cont.Class import Control.Monad.Error.Class import Control.Monad.Fix-import Control.Monad.RWS.Class import Control.Monad.Reader.Class import Control.Monad.State.Class import Control.Monad.Trans import Control.Monad.Writer.Class+import Control.Monad.RWS.Class import Control.Monad.Instances ()-import System.IO +-- | Note: this instance does not satisfy the second 'MonadPlus' law+--+-- > v >> mzero = mzero+-- instance MonadPlus IO where mzero = ioError (userError "mzero") m `mplus` n = m `catch` \_ -> n@@ -73,23 +79,28 @@ -- --------------------------------------------------------------------------- -- Our parameterizable error monad -instance (Error e) => Monad (Either e) where+#if !(MIN_VERSION_base(4,2,1))++-- These instances are in base-4.3++instance Monad (Either e) where return = Right Left l >>= _ = Left l Right r >>= k = k r- fail msg = Left (strMsg msg) -instance (Error e) => MonadPlus (Either e) where- mzero = Left noMsg- Left _ `mplus` n = n- m `mplus` _ = m--instance (Error e) => MonadFix (Either e) where+instance MonadFix (Either e) where mfix f = let a = f $ case a of Right r -> r _ -> error "empty mfix argument" in a++#endif /* base to 4.2.0.x */++instance (Error e) => MonadPlus (Either e) where+ mzero = Left noMsg+ Left _ `mplus` n = n+ m `mplus` _ = m instance (Error e) => MonadError e (Either e) where throwError = Left
Control/Monad/Error/Class.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-undecidable-instances #-}+{-# LANGUAGE UndecidableInstances #-} -- Needed for the same reasons as in Reader, State etc {- |
Control/Monad/List.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-undecidable-instances #-}+{-# LANGUAGE UndecidableInstances #-} -- Needed for the same reasons as in Reader, State etc -----------------------------------------------------------------------------
Control/Monad/RWS/Lazy.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-undecidable-instances #-}+{-# LANGUAGE UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.RWS.Lazy@@ -41,11 +41,11 @@ import Control.Monad.Cont.Class import Control.Monad.Error.Class import Control.Monad.Fix-import Control.Monad.RWS.Class import Control.Monad.Reader.Class import Control.Monad.State.Class import Control.Monad.Trans import Control.Monad.Writer.Class+import Control.Monad.RWS.Class import Data.Monoid newtype RWS r w s a = RWS { runRWS :: r -> s -> (a, s, w) }
Control/Monad/RWS/Strict.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-undecidable-instances #-}+{-# LANGUAGE UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.RWS.Strict@@ -41,11 +41,11 @@ import Control.Monad.Cont.Class import Control.Monad.Error.Class import Control.Monad.Fix-import Control.Monad.RWS.Class import Control.Monad.Reader.Class import Control.Monad.State.Class import Control.Monad.Trans import Control.Monad.Writer.Class+import Control.Monad.RWS.Class import Data.Monoid newtype RWS r w s a = RWS { runRWS :: r -> s -> (a, s, w) }
Control/Monad/Reader.hs view
@@ -1,5 +1,4 @@-{-# OPTIONS_GHC -fno-warn-orphans #-} -- Temporary, I hope. SLPJ Aug08-{-# OPTIONS -fallow-undecidable-instances #-}+{-# LANGUAGE UndecidableInstances #-} {- | Module : Control.Monad.Reader Copyright : (c) Andy Gill 2001,@@ -69,13 +68,6 @@ import Control.Monad.Trans import Control.Monad.Writer.Class --- ------------------------------------------------------------------------------- The partially applied function type is a simple reader monad--instance MonadReader r ((->) r) where- ask = id- local f m = m . f- {- | The parameterizable reader monad. @@ -175,12 +167,12 @@ m `catchError` h = ReaderT $ \r -> runReaderT m r `catchError` \e -> runReaderT (h e) r --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (MonadState s m) => MonadState s (ReaderT r m) where get = lift get put = lift . put --- This instance needs -fallow-undecidable-instances, because+-- This instance needs UndecidableInstances, because -- it does not satisfy the coverage condition instance (MonadWriter w m) => MonadWriter w (ReaderT r m) where tell = lift . tell
Control/Monad/Reader/Class.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-undecidable-instances #-}+{-# LANGUAGE UndecidableInstances #-} {- | Module : Control.Monad.Reader.Class Copyright : (c) Andy Gill 2001,@@ -42,6 +42,8 @@ asks, ) where +import Control.Monad.Instances ()+ {- | See examples in "Control.Monad.Reader". Note, the partially applied function type @(->) r@ is a simple reader monad.@@ -59,6 +61,13 @@ * The resulting @Reader@. -} local :: (r -> r) -> m a -> m a++-- ----------------------------------------------------------------------------+-- The partially applied function type is a simple reader monad++instance MonadReader r ((->) r) where+ ask = id+ local f m = m . f {- | Retrieves a function of the current environment. Parameters:
Control/Monad/State/Lazy.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS -fallow-undecidable-instances #-}--- Search for -fallow-undecidable-instances to see why this is needed+{-# LANGUAGE UndecidableInstances #-}+-- Search for UndecidableInstances to see why this is needed ----------------------------------------------------------------------------- -- |@@ -210,12 +210,12 @@ m `catchError` h = StateT $ \s -> runStateT m s `catchError` \e -> runStateT (h e) s --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (MonadReader r m) => MonadReader r (StateT s m) where ask = lift ask local f m = StateT $ \s -> local f (runStateT m s) --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (MonadWriter w m) => MonadWriter w (StateT s m) where tell = lift . tell listen m = StateT $ \s -> do
Control/Monad/State/Strict.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS -fallow-undecidable-instances #-}--- Search for -fallow-undecidable-instances to see why this is needed+{-# LANGUAGE UndecidableInstances #-}+-- Search for UndecidableInstances to see why this is needed ----------------------------------------------------------------------------- -- |@@ -209,12 +209,12 @@ m `catchError` h = StateT $ \s -> runStateT m s `catchError` \e -> runStateT (h e) s --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (MonadReader r m) => MonadReader r (StateT s m) where ask = lift ask local f m = StateT $ \s -> local f (runStateT m s) --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (MonadWriter w m) => MonadWriter w (StateT s m) where tell = lift . tell listen m = StateT $ \s -> do
Control/Monad/Trans.hs view
@@ -23,8 +23,6 @@ MonadIO(..), ) where -import System.IO- -- --------------------------------------------------------------------------- -- MonadTrans class --
Control/Monad/Writer.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS -fallow-undecidable-instances #-}--- Search for -fallow-undecidable-instances to see why this is needed+{-# LANGUAGE UndecidableInstances #-}+-- Search for UndecidableInstances to see why this is needed ----------------------------------------------------------------------------- -- |
Control/Monad/Writer/Class.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS -fallow-undecidable-instances #-}--- Search for -fallow-undecidable-instances to see why this is needed+{-# LANGUAGE UndecidableInstances #-}+-- Search for UndecidableInstances to see why this is needed ----------------------------------------------------------------------------- -- |
Control/Monad/Writer/Lazy.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS -fallow-undecidable-instances #-}--- Search for -fallow-undecidable-instances to see why this is needed+{-# LANGUAGE UndecidableInstances #-}+-- Search for UndecidableInstances to see why this is needed ----------------------------------------------------------------------------- -- |@@ -137,13 +137,13 @@ m `catchError` h = WriterT $ runWriterT m `catchError` \e -> runWriterT (h e) --- This instance needs -fallow-undecidable-instances, because+-- This instance needs UndecidableInstances, because -- it does not satisfy the coverage condition instance (Monoid w, MonadReader r m) => MonadReader r (WriterT w m) where ask = lift ask local f m = WriterT $ local f (runWriterT m) --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (Monoid w, MonadState s m) => MonadState s (WriterT w m) where get = lift get put = lift . put
Control/Monad/Writer/Strict.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS -fallow-undecidable-instances #-}--- Search for -fallow-undecidable-instances to see why this is needed+{-# LANGUAGE UndecidableInstances #-}+-- Search for UndecidableInstances to see why this is needed ----------------------------------------------------------------------------- -- |@@ -139,13 +139,13 @@ m `catchError` h = WriterT $ runWriterT m `catchError` \e -> runWriterT (h e) --- This instance needs -fallow-undecidable-instances, because+-- This instance needs UndecidableInstances, because -- it does not satisfy the coverage condition instance (Monoid w, MonadReader r m) => MonadReader r (WriterT w m) where ask = lift ask local f m = WriterT $ local f (runWriterT m) --- Needs -fallow-undecidable-instances+-- Needs UndecidableInstances instance (Monoid w, MonadState s m) => MonadState s (WriterT w m) where get = lift get put = lift . put
− Makefile.inc
@@ -1,7 +0,0 @@-ifeq "" "${MKDIR}"-MKDIR:=$(shell pwd)-#MKDIR:=$(PWD)-else-MKDIR:=$(patsubst %/$(notdir ${MKDIR}),%, ${MKDIR})-endif-include ${MKDIR}/Makefile.inc
− Makefile.nhc98
@@ -1,12 +0,0 @@-THISPKG = mtl-SEARCH =--SRCS = \- Control/Monad/Identity.hs \- Control/Monad/Trans.hs--# Here are the main rules.-include ../Makefile.common--# (no dependencies)-
mtl.cabal view
@@ -1,5 +1,5 @@ name: mtl-version: 1.1.0.2+version: 1.1.1.0 license: BSD3 license-file: LICENSE author: Andy Gill@@ -35,7 +35,7 @@ Control.Monad.Writer.Class Control.Monad.Writer.Lazy Control.Monad.Writer.Strict-build-depends: base+build-depends: base < 5 extensions: MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances,
− prologue.txt
@@ -1,4 +0,0 @@-A monad transformer library, inspired by the paper-/Functional Programming with Overloading and Higher-Order Polymorphism/,-Mark P Jones (<http://www.cse.ogi.edu/~mpj/>)-Advanced School of Functional Programming, 1995.