transformers 0.6.1.1 → 0.6.1.2
raw patch · 19 files changed
+70/−21 lines, 19 files
Files
- Control/Applicative/Backwards.hs +1/−1
- Control/Applicative/Lift.hs +1/−1
- Control/Monad/Signatures.hs +8/−4
- Control/Monad/Trans/Accum.hs +3/−0
- Control/Monad/Trans/Except.hs +10/−4
- Control/Monad/Trans/Identity.hs +1/−1
- Control/Monad/Trans/Maybe.hs +1/−1
- Control/Monad/Trans/RWS/CPS.hs +3/−0
- Control/Monad/Trans/RWS/Lazy.hs +3/−0
- Control/Monad/Trans/RWS/Strict.hs +3/−0
- Control/Monad/Trans/State/Lazy.hs +3/−0
- Control/Monad/Trans/State/Strict.hs +3/−0
- Control/Monad/Trans/Writer/CPS.hs +6/−2
- Control/Monad/Trans/Writer/Lazy.hs +7/−1
- Control/Monad/Trans/Writer/Strict.hs +7/−1
- Data/Functor/Constant.hs +1/−1
- Data/Functor/Reverse.hs +1/−1
- changelog +5/−0
- transformers.cabal +3/−3
Control/Applicative/Backwards.hs view
@@ -41,7 +41,7 @@ import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length) import Control.Applicative import Data.Foldable-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Traversable (Traversable(traverse, sequenceA)) #endif
Control/Applicative/Lift.hs view
@@ -39,7 +39,7 @@ import Control.Applicative import Data.Functor.Constant-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Foldable (Foldable(foldMap)) import Data.Monoid (Monoid(..)) import Data.Traversable (Traversable(traverse))
Control/Monad/Signatures.hs view
@@ -27,23 +27,27 @@ -- introduced in "Control.Monad.Trans.Cont". -- Any lifting function @liftCallCC@ should satisfy ----- * @'Control.Monad.Trans.Class.lift' (f k) = f' ('Control.Monad.Trans.Class.lift' . k) => 'Control.Monad.Trans.Class.lift' (cf f) = liftCallCC cf f'@+-- @'Control.Monad.Trans.Class.lift' (f k) = f' ('Control.Monad.Trans.Class.lift' . k) => 'Control.Monad.Trans.Class.lift' (cf f) = liftCallCC cf f'@ --+-- This implies that on entry to the continuation any outer monad+-- transformer effect inside @callCC@ will have been rolled back. type CallCC m a b = ((a -> m b) -> m a) -> m a -- | Signature of the @catchE@ operation, -- introduced in "Control.Monad.Trans.Except". -- Any lifting function @liftCatch@ should satisfy ----- * @'Control.Monad.Trans.Class.lift' (cf m f) = liftCatch ('Control.Monad.Trans.Class.lift' . cf) ('Control.Monad.Trans.Class.lift' f)@+-- @'Control.Monad.Trans.Class.lift' (cf m h) = liftCatch cf ('Control.Monad.Trans.Class.lift' m) ('Control.Monad.Trans.Class.lift' . h)@ --+-- This implies that on entry to the handler function any outer monad+-- transformer effect inside @catchE@ will have been rolled back. type Catch e m a = m a -> (e -> m a) -> m a -- | Signature of the @listen@ operation, -- introduced in "Control.Monad.Trans.Writer". -- Any lifting function @liftListen@ should satisfy ----- * @'Control.Monad.Trans.Class.lift' . liftListen = liftListen . 'Control.Monad.Trans.Class.lift'@+-- @'Control.Monad.Trans.Class.lift' . liftListen = liftListen . 'Control.Monad.Trans.Class.lift'@ -- type Listen w m a = m a -> m (a, w) @@ -51,6 +55,6 @@ -- introduced in "Control.Monad.Trans.Writer". -- Any lifting function @liftPass@ should satisfy ----- * @'Control.Monad.Trans.Class.lift' . liftPass = liftPass . 'Control.Monad.Trans.Class.lift'@+-- @'Control.Monad.Trans.Class.lift' . liftPass = liftPass . 'Control.Monad.Trans.Class.lift'@ -- type Pass w m a = m (a, w -> w) -> m a
Control/Monad/Trans/Accum.hs view
@@ -279,6 +279,9 @@ {-# INLINE liftCallCC' #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @catchE@ discards any output from the body on entering+-- the handler. liftCatch :: Catch e m (a, w) -> Catch e (AccumT w m) a liftCatch catchE m h = AccumT $ \ w -> runAccumT m w `catchE` \ e -> runAccumT (h e) w
Control/Monad/Trans/Except.hs view
@@ -16,7 +16,8 @@ -- Stability : experimental -- Portability : portable ----- This monad transformer extends a monad with the ability to throw exceptions.+-- This monad transformer extends a monad with the ability to throw+-- and catch exceptions. -- -- A sequence of actions terminates normally, producing a value, -- only if none of the actions in the sequence throws an exception.@@ -69,7 +70,7 @@ #if MIN_VERSION_base(4,4,0) import Control.Monad.Zip (MonadZip(mzipWith)) #endif-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Foldable (Foldable(foldMap)) import Data.Monoid (Monoid(mempty, mappend)) import Data.Traversable (Traversable(traverse))@@ -80,7 +81,9 @@ -- | The parameterizable exception monad. ----- Computations are either exceptions or normal values.+-- Computations are either exceptions (of any type) or normal values.+-- These computations are plain values, and are unrelated to the+-- "Control.Exception" mechanism, which is tied to the 'IO' monad. -- -- The 'return' function returns a normal value, while @>>=@ exits on -- the first exception. For a variant that continues after an error@@ -118,9 +121,12 @@ -- -- @ExceptT@ constructs a monad parameterized over two things: ----- * e - The exception type.+-- * e - An arbitrary exception type. -- -- * m - The inner monad.+--+-- The monadic computations are a plain values. They are unrelated to+-- the "Control.Exception" mechanism, which is tied to the 'IO' monad. -- -- The 'return' function yields a computation that produces the given -- value, while @>>=@ sequences two subcomputations, exiting on the
Control/Monad/Trans/Identity.hs view
@@ -54,7 +54,7 @@ import Control.Monad.Zip (MonadZip(mzipWith)) #endif import Data.Foldable-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Traversable (Traversable(traverse)) #endif import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length)
Control/Monad/Trans/Maybe.hs view
@@ -61,7 +61,7 @@ import Control.Monad.Zip (MonadZip(mzipWith)) #endif import Data.Maybe (fromMaybe)-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Foldable (Foldable(foldMap)) import Data.Traversable (Traversable(traverse)) #endif
Control/Monad/Trans/RWS/CPS.hs view
@@ -409,6 +409,9 @@ {-# INLINE liftCallCC' #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @catchE@ discards any output or changes to the state from+-- the body on entering the handler. liftCatch :: Catch e m (a,s,w) -> Catch e (RWST r w s m) a liftCatch catchE m h = RWST $ \ r s w -> unRWST m r s w `catchE` \ e -> unRWST (h e) r s w
Control/Monad/Trans/RWS/Lazy.hs view
@@ -393,6 +393,9 @@ {-# INLINE liftCallCC' #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @catchE@ discards any output or changes to the state from+-- the body on entering the handler. liftCatch :: Catch e m (a,s,w) -> Catch e (RWST r w s m) a liftCatch catchE m h = RWST $ \ r s -> runRWST m r s `catchE` \ e -> runRWST (h e) r s
Control/Monad/Trans/RWS/Strict.hs view
@@ -397,6 +397,9 @@ {-# INLINE liftCallCC' #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @catchE@ discards any output or changes to the state from+-- the body on entering the handler. liftCatch :: Catch e m (a,s,w) -> Catch e (RWST r w s m) a liftCatch catchE m h = RWST $ \ r s -> runRWST m r s `catchE` \ e -> runRWST (h e) r s
Control/Monad/Trans/State/Lazy.hs view
@@ -336,6 +336,9 @@ {-# INLINE liftCallCC' #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies+-- that the lifted @catchE@ rolls back to the original state on entering+-- the handler. liftCatch :: Catch e m (a,s) -> Catch e (StateT s m) a liftCatch catchE m h = StateT $ \ s -> runStateT m s `catchE` \ e -> runStateT (h e) s
Control/Monad/Trans/State/Strict.hs view
@@ -337,6 +337,9 @@ {-# INLINE liftCallCC' #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies+-- that the lifted @catchE@ rolls back to the original state on entering+-- the handler. liftCatch :: Catch e m (a,s) -> Catch e (StateT s m) a liftCatch catchE m h = StateT $ \ s -> runStateT m s `catchE` \ e -> runStateT (h e) s
Control/Monad/Trans/Writer/CPS.hs view
@@ -283,14 +283,18 @@ {-# INLINE censor #-} -- | Uniform lifting of a @callCC@ operation to the new monad.--- This version rolls back to the original state on entering the--- continuation.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @callCC@ discards any output from the body on entering+-- the saved continuation. liftCallCC :: CallCC m (a, w) (b, w) -> CallCC (WriterT w m) a b liftCallCC callCC f = WriterT $ \ w -> callCC $ \ c -> unWriterT (f (\ a -> WriterT $ \ _ -> c (a, w))) w {-# INLINE liftCallCC #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @catchE@ discards any output from the body on entering+-- the handler. liftCatch :: Catch e m (a, w) -> Catch e (WriterT w m) a liftCatch catchE m h = WriterT $ \ w -> unWriterT m w `catchE` \ e -> unWriterT (h e) w
Control/Monad/Trans/Writer/Lazy.hs view
@@ -70,7 +70,7 @@ #endif import Data.Foldable import Data.Monoid-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Traversable (Traversable(traverse)) #endif import Prelude hiding (null, length)@@ -317,6 +317,9 @@ {-# INLINE censor #-} -- | Lift a @callCC@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @callCC@ discards any output from the body on entering+-- the saved condinuation. liftCallCC :: (Monoid w) => CallCC m (a,w) (b,w) -> CallCC (WriterT w m) a b liftCallCC callCC f = WriterT $ callCC $ \ c ->@@ -324,6 +327,9 @@ {-# INLINE liftCallCC #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @catchE@ discards any output from the body on entering+-- the handler. liftCatch :: Catch e m (a,w) -> Catch e (WriterT w m) a liftCatch catchE m h = WriterT $ runWriterT m `catchE` \ e -> runWriterT (h e)
Control/Monad/Trans/Writer/Strict.hs view
@@ -73,7 +73,7 @@ #endif import Data.Foldable import Data.Monoid-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Traversable (Traversable(traverse)) #endif import Prelude hiding (null, length)@@ -320,6 +320,9 @@ {-# INLINE censor #-} -- | Lift a @callCC@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @callCC@ discards any output from the body on entering+-- the saved continuation. liftCallCC :: (Monoid w) => CallCC m (a,w) (b,w) -> CallCC (WriterT w m) a b liftCallCC callCC f = WriterT $ callCC $ \ c ->@@ -327,6 +330,9 @@ {-# INLINE liftCallCC #-} -- | Lift a @catchE@ operation to the new monad.+-- The uniformity property (see "Control.Monad.Signatures") implies that+-- the lifted @catchE@ discards any output from the body on entering+-- the handler. liftCatch :: Catch e m (a,w) -> Catch e (WriterT w m) a liftCatch catchE m h = WriterT $ runWriterT m `catchE` \ e -> runWriterT (h e)
Data/Functor/Constant.hs view
@@ -36,7 +36,7 @@ import Control.Applicative import Data.Foldable-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Monoid (Monoid(..)) import Data.Traversable (Traversable(traverse)) #endif
Data/Functor/Reverse.hs view
@@ -43,7 +43,7 @@ import qualified Control.Monad.Fail as Fail #endif import Data.Foldable-#if !(MIN_VERSION_base(4,8,0))+#if !(MIN_VERSION_base(4,8,0)) || defined(__MHS__) import Data.Traversable (Traversable(traverse)) #endif import Data.Monoid
changelog view
@@ -1,5 +1,10 @@ -*-change-log-*- +0.6.1.2 Ross Paterson <R.Paterson@city.ac.uk> Sep 2024+ * Portability fixes for MicroHs+ * Include image files in the bundle+ * Expand ExceptT documentation+ 0.6.1.1 Ross Paterson <R.Paterson@city.ac.uk> Aug 2023 * Additions to documentation, especially of AccumT.
transformers.cabal view
@@ -1,5 +1,5 @@ name: transformers-version: 0.6.1.1+version: 0.6.1.2 license: BSD3 license-file: LICENSE author: Andy Gill, Ross Paterson@@ -47,13 +47,13 @@ default-language: Haskell2010 build-depends: base >= 2 && < 6 hs-source-dirs: .- if !impl(ghc>=7.9)+ if impl(ghc<7.9) -- Data.Functor.Identity was moved into base-4.8.0.0 (GHC 7.10) -- see also https://ghc.haskell.org/trac/ghc/ticket/9664 -- NB: using impl(ghc>=7.9) instead of fragile Cabal flags hs-source-dirs: legacy/pre709 exposed-modules: Data.Functor.Identity- if !impl(ghc>=7.11)+ if impl(ghc<7.11) -- modules moved into base-4.9.0 (GHC 8.0) -- see https://ghc.haskell.org/trac/ghc/ticket/10773 -- see https://ghc.haskell.org/trac/ghc/ticket/11135