packages feed

transformers 0.4.1.0 → 0.4.2.0

raw patch · 27 files changed

+235/−90 lines, 27 filesdep −special-functorsdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies removed: special-functors

Dependency ranges changed: base

API changes (from Hackage documentation)

- Control.Applicative.Backwards: Backwards :: f a -> Backwards f a
- Control.Applicative.Backwards: forwards :: Backwards f a -> f a
- Control.Applicative.Lift: Other :: (f a) -> Lift f a
- Control.Applicative.Lift: Pure :: a -> Lift f a
- Control.Monad.Trans.Cont: ContT :: ((a -> m r) -> m r) -> ContT r m a
- Control.Monad.Trans.Cont: runContT :: ContT r m a -> (a -> m r) -> m r
- Control.Monad.Trans.Error: ErrorT :: m (Either e a) -> ErrorT e m a
- Control.Monad.Trans.Error: runErrorT :: ErrorT e m a -> m (Either e a)
- Control.Monad.Trans.Except: ExceptT :: (m (Either e a)) -> ExceptT e m a
- Control.Monad.Trans.Identity: IdentityT :: f a -> IdentityT f a
- Control.Monad.Trans.Identity: runIdentityT :: IdentityT f a -> f a
- Control.Monad.Trans.List: ListT :: m [a] -> ListT m a
- Control.Monad.Trans.List: runListT :: ListT m a -> m [a]
- Control.Monad.Trans.Maybe: MaybeT :: m (Maybe a) -> MaybeT m a
- Control.Monad.Trans.Maybe: runMaybeT :: MaybeT m a -> m (Maybe a)
- Control.Monad.Trans.RWS.Lazy: RWST :: (r -> s -> m (a, s, w)) -> RWST r w s m a
- Control.Monad.Trans.RWS.Lazy: runRWST :: RWST r w s m a -> r -> s -> m (a, s, w)
- Control.Monad.Trans.RWS.Strict: RWST :: (r -> s -> m (a, s, w)) -> RWST r w s m a
- Control.Monad.Trans.RWS.Strict: runRWST :: RWST r w s m a -> r -> s -> m (a, s, w)
- Control.Monad.Trans.Reader: ReaderT :: (r -> m a) -> ReaderT r m a
- Control.Monad.Trans.Reader: runReaderT :: ReaderT r m a -> r -> m a
- Control.Monad.Trans.State.Lazy: StateT :: (s -> m (a, s)) -> StateT s m a
- Control.Monad.Trans.State.Lazy: runStateT :: StateT s m a -> s -> m (a, s)
- Control.Monad.Trans.State.Strict: StateT :: (s -> m (a, s)) -> StateT s m a
- Control.Monad.Trans.State.Strict: runStateT :: StateT s m a -> s -> m (a, s)
- Control.Monad.Trans.Writer.Lazy: WriterT :: m (a, w) -> WriterT w m a
- Control.Monad.Trans.Writer.Lazy: runWriterT :: WriterT w m a -> m (a, w)
- Control.Monad.Trans.Writer.Strict: WriterT :: m (a, w) -> WriterT w m a
- Control.Monad.Trans.Writer.Strict: runWriterT :: WriterT w m a -> m (a, w)
- Data.Functor.Compose: Compose :: f (g a) -> Compose f g a
- Data.Functor.Compose: getCompose :: Compose f g a -> f (g a)
- Data.Functor.Constant: Constant :: a -> Constant a b
- Data.Functor.Constant: getConstant :: Constant a b -> a
- Data.Functor.Identity: Identity :: a -> Identity a
- Data.Functor.Identity: instance Applicative Identity
- Data.Functor.Identity: instance Eq a => Eq (Identity a)
- Data.Functor.Identity: instance Eq1 Identity
- Data.Functor.Identity: instance Foldable Identity
- Data.Functor.Identity: instance Functor Identity
- Data.Functor.Identity: instance Monad Identity
- Data.Functor.Identity: instance MonadFix Identity
- Data.Functor.Identity: instance Ord a => Ord (Identity a)
- Data.Functor.Identity: instance Ord1 Identity
- Data.Functor.Identity: instance Read a => Read (Identity a)
- Data.Functor.Identity: instance Read1 Identity
- Data.Functor.Identity: instance Show a => Show (Identity a)
- Data.Functor.Identity: instance Show1 Identity
- Data.Functor.Identity: instance Traversable Identity
- Data.Functor.Identity: newtype Identity a
- Data.Functor.Identity: runIdentity :: Identity a -> a
- Data.Functor.Product: Pair :: (f a) -> (g a) -> Product f g a
- Data.Functor.Reverse: Reverse :: f a -> Reverse f a
- Data.Functor.Reverse: getReverse :: Reverse f a -> f a
- Data.Functor.Sum: InL :: (f a) -> Sum f g a
- Data.Functor.Sum: InR :: (g a) -> Sum f g a
+ Control.Applicative.Backwards: [Backwards] :: f a -> Backwards f a
+ Control.Applicative.Backwards: [forwards] :: Backwards f a -> f a
+ Control.Applicative.Lift: [Other] :: (f a) -> Lift f a
+ Control.Applicative.Lift: [Pure] :: a -> Lift f a
+ Control.Applicative.Lift: mapLift :: (f a -> g a) -> Lift f a -> Lift g a
+ Control.Applicative.Lift: runErrors :: Errors e a -> Either e a
+ Control.Monad.Trans.Cont: [ContT] :: ((a -> m r) -> m r) -> ContT r m a
+ Control.Monad.Trans.Cont: [runContT] :: ContT r m a -> (a -> m r) -> m r
+ Control.Monad.Trans.Error: [ErrorT] :: m (Either e a) -> ErrorT e m a
+ Control.Monad.Trans.Error: [runErrorT] :: ErrorT e m a -> m (Either e a)
+ Control.Monad.Trans.Except: [ExceptT] :: (m (Either e a)) -> ExceptT e m a
+ Control.Monad.Trans.Identity: [IdentityT] :: f a -> IdentityT f a
+ Control.Monad.Trans.Identity: [runIdentityT] :: IdentityT f a -> f a
+ Control.Monad.Trans.List: [ListT] :: m [a] -> ListT m a
+ Control.Monad.Trans.List: [runListT] :: ListT m a -> m [a]
+ Control.Monad.Trans.Maybe: [MaybeT] :: m (Maybe a) -> MaybeT m a
+ Control.Monad.Trans.Maybe: [runMaybeT] :: MaybeT m a -> m (Maybe a)
+ Control.Monad.Trans.RWS.Lazy: [RWST] :: (r -> s -> m (a, s, w)) -> RWST r w s m a
+ Control.Monad.Trans.RWS.Lazy: [runRWST] :: RWST r w s m a -> r -> s -> m (a, s, w)
+ Control.Monad.Trans.RWS.Strict: [RWST] :: (r -> s -> m (a, s, w)) -> RWST r w s m a
+ Control.Monad.Trans.RWS.Strict: [runRWST] :: RWST r w s m a -> r -> s -> m (a, s, w)
+ Control.Monad.Trans.Reader: [ReaderT] :: (r -> m a) -> ReaderT r m a
+ Control.Monad.Trans.Reader: [runReaderT] :: ReaderT r m a -> r -> m a
+ Control.Monad.Trans.State.Lazy: [StateT] :: (s -> m (a, s)) -> StateT s m a
+ Control.Monad.Trans.State.Lazy: [runStateT] :: StateT s m a -> s -> m (a, s)
+ Control.Monad.Trans.State.Strict: [StateT] :: (s -> m (a, s)) -> StateT s m a
+ Control.Monad.Trans.State.Strict: [runStateT] :: StateT s m a -> s -> m (a, s)
+ Control.Monad.Trans.Writer.Lazy: [WriterT] :: m (a, w) -> WriterT w m a
+ Control.Monad.Trans.Writer.Lazy: [runWriterT] :: WriterT w m a -> m (a, w)
+ Control.Monad.Trans.Writer.Strict: [WriterT] :: m (a, w) -> WriterT w m a
+ Control.Monad.Trans.Writer.Strict: [runWriterT] :: WriterT w m a -> m (a, w)
+ Data.Functor.Classes: instance Eq1 Identity
+ Data.Functor.Classes: instance Ord1 Identity
+ Data.Functor.Classes: instance Read1 Identity
+ Data.Functor.Classes: instance Show1 Identity
+ Data.Functor.Compose: [Compose] :: f (g a) -> Compose f g a
+ Data.Functor.Compose: [getCompose] :: Compose f g a -> f (g a)
+ Data.Functor.Constant: [Constant] :: a -> Constant a b
+ Data.Functor.Constant: [getConstant] :: Constant a b -> a
+ Data.Functor.Product: [Pair] :: (f a) -> (g a) -> Product f g a
+ Data.Functor.Reverse: [Reverse] :: f a -> Reverse f a
+ Data.Functor.Reverse: [getReverse] :: Reverse f a -> f a
+ Data.Functor.Sum: [InL] :: (f a) -> Sum f g a
+ Data.Functor.Sum: [InR] :: (g a) -> Sum f g a
- Control.Applicative.Lift: failure :: Monoid e => e -> Errors e a
+ Control.Applicative.Lift: failure :: (Monoid e) => e -> Errors e a
- Control.Applicative.Lift: unLift :: Applicative f => Lift f a -> f a
+ Control.Applicative.Lift: unLift :: (Applicative f) => Lift f a -> f a
- Control.Monad.IO.Class: class Monad m => MonadIO m
+ Control.Monad.IO.Class: class (Monad m) => MonadIO m
- Control.Monad.Trans.Cont: evalContT :: Monad m => ContT r m r -> m r
+ Control.Monad.Trans.Cont: evalContT :: (Monad m) => ContT r m r -> m r
- Control.Monad.Trans.Cont: liftLocal :: Monad m => m r' -> ((r' -> r') -> m r -> m r) -> (r' -> r') -> ContT r m a -> ContT r m a
+ Control.Monad.Trans.Cont: liftLocal :: (Monad m) => m r' -> ((r' -> r') -> m r -> m r) -> (r' -> r') -> ContT r m a -> ContT r m a
- Control.Monad.Trans.Cont: resetT :: Monad m => ContT r m r -> ContT r' m r
+ Control.Monad.Trans.Cont: resetT :: (Monad m) => ContT r m r -> ContT r' m r
- Control.Monad.Trans.Cont: shiftT :: Monad m => ((a -> m r) -> ContT r m r) -> ContT r m a
+ Control.Monad.Trans.Cont: shiftT :: (Monad m) => ((a -> m r) -> ContT r m r) -> ContT r m a
- Control.Monad.Trans.Error: liftListen :: Monad m => Listen w m (Either e a) -> Listen w (ErrorT e m) a
+ Control.Monad.Trans.Error: liftListen :: (Monad m) => Listen w m (Either e a) -> Listen w (ErrorT e m) a
- Control.Monad.Trans.Error: liftPass :: Monad m => Pass w m (Either e a) -> Pass w (ErrorT e m) a
+ Control.Monad.Trans.Error: liftPass :: (Monad m) => Pass w m (Either e a) -> Pass w (ErrorT e m) a
- Control.Monad.Trans.Except: catchE :: Monad m => ExceptT e m a -> (e -> ExceptT e' m a) -> ExceptT e' m a
+ Control.Monad.Trans.Except: catchE :: (Monad m) => ExceptT e m a -> (e -> ExceptT e' m a) -> ExceptT e' m a
- Control.Monad.Trans.Except: liftListen :: Monad m => Listen w m (Either e a) -> Listen w (ExceptT e m) a
+ Control.Monad.Trans.Except: liftListen :: (Monad m) => Listen w m (Either e a) -> Listen w (ExceptT e m) a
- Control.Monad.Trans.Except: liftPass :: Monad m => Pass w m (Either e a) -> Pass w (ExceptT e m) a
+ Control.Monad.Trans.Except: liftPass :: (Monad m) => Pass w m (Either e a) -> Pass w (ExceptT e m) a
- Control.Monad.Trans.Except: throwE :: Monad m => e -> ExceptT e m a
+ Control.Monad.Trans.Except: throwE :: (Monad m) => e -> ExceptT e m a
- Control.Monad.Trans.Except: withExceptT :: Functor m => (e -> e') -> ExceptT e m a -> ExceptT e' m a
+ Control.Monad.Trans.Except: withExceptT :: (Functor m) => (e -> e') -> ExceptT e m a -> ExceptT e' m a
- Control.Monad.Trans.Maybe: exceptToMaybeT :: Functor m => ExceptT e m a -> MaybeT m a
+ Control.Monad.Trans.Maybe: exceptToMaybeT :: (Functor m) => ExceptT e m a -> MaybeT m a
- Control.Monad.Trans.Maybe: liftListen :: Monad m => Listen w m (Maybe a) -> Listen w (MaybeT m) a
+ Control.Monad.Trans.Maybe: liftListen :: (Monad m) => Listen w m (Maybe a) -> Listen w (MaybeT m) a
- Control.Monad.Trans.Maybe: liftPass :: Monad m => Pass w m (Maybe a) -> Pass w (MaybeT m) a
+ Control.Monad.Trans.Maybe: liftPass :: (Monad m) => Pass w m (Maybe a) -> Pass w (MaybeT m) a
- Control.Monad.Trans.Maybe: maybeToExceptT :: Functor m => e -> MaybeT m a -> ExceptT e m a
+ Control.Monad.Trans.Maybe: maybeToExceptT :: (Functor m) => e -> MaybeT m a -> ExceptT e m a
- Control.Monad.Trans.RWS.Lazy: evalRWST :: Monad m => RWST r w s m a -> r -> s -> m (a, w)
+ Control.Monad.Trans.RWS.Lazy: evalRWST :: (Monad m) => RWST r w s m a -> r -> s -> m (a, w)
- Control.Monad.Trans.RWS.Lazy: execRWST :: Monad m => RWST r w s m a -> r -> s -> m (s, w)
+ Control.Monad.Trans.RWS.Lazy: execRWST :: (Monad m) => RWST r w s m a -> r -> s -> m (s, w)
- Control.Monad.Trans.RWS.Lazy: liftCallCC :: Monoid w => CallCC m (a, s, w) (b, s, w) -> CallCC (RWST r w s m) a b
+ Control.Monad.Trans.RWS.Lazy: liftCallCC :: (Monoid w) => CallCC m (a, s, w) (b, s, w) -> CallCC (RWST r w s m) a b
- Control.Monad.Trans.RWS.Lazy: liftCallCC' :: Monoid w => CallCC m (a, s, w) (b, s, w) -> CallCC (RWST r w s m) a b
+ Control.Monad.Trans.RWS.Lazy: liftCallCC' :: (Monoid w) => CallCC m (a, s, w) (b, s, w) -> CallCC (RWST r w s m) a b
- Control.Monad.Trans.RWS.Lazy: writer :: Monad m => (a, w) -> RWST r w s m a
+ Control.Monad.Trans.RWS.Lazy: writer :: (Monad m) => (a, w) -> RWST r w s m a
- Control.Monad.Trans.RWS.Strict: evalRWST :: Monad m => RWST r w s m a -> r -> s -> m (a, w)
+ Control.Monad.Trans.RWS.Strict: evalRWST :: (Monad m) => RWST r w s m a -> r -> s -> m (a, w)
- Control.Monad.Trans.RWS.Strict: execRWST :: Monad m => RWST r w s m a -> r -> s -> m (s, w)
+ Control.Monad.Trans.RWS.Strict: execRWST :: (Monad m) => RWST r w s m a -> r -> s -> m (s, w)
- Control.Monad.Trans.RWS.Strict: liftCallCC :: Monoid w => CallCC m (a, s, w) (b, s, w) -> CallCC (RWST r w s m) a b
+ Control.Monad.Trans.RWS.Strict: liftCallCC :: (Monoid w) => CallCC m (a, s, w) (b, s, w) -> CallCC (RWST r w s m) a b
- Control.Monad.Trans.RWS.Strict: liftCallCC' :: Monoid w => CallCC m (a, s, w) (b, s, w) -> CallCC (RWST r w s m) a b
+ Control.Monad.Trans.RWS.Strict: liftCallCC' :: (Monoid w) => CallCC m (a, s, w) (b, s, w) -> CallCC (RWST r w s m) a b
- Control.Monad.Trans.RWS.Strict: writer :: Monad m => (a, w) -> RWST r w s m a
+ Control.Monad.Trans.RWS.Strict: writer :: (Monad m) => (a, w) -> RWST r w s m a
- Control.Monad.Trans.Reader: ask :: Monad m => ReaderT r m r
+ Control.Monad.Trans.Reader: ask :: (Monad m) => ReaderT r m r
- Control.Monad.Trans.Reader: asks :: Monad m => (r -> a) -> ReaderT r m a
+ Control.Monad.Trans.Reader: asks :: (Monad m) => (r -> a) -> ReaderT r m a
- Control.Monad.Trans.Reader: local :: Monad m => (r -> r) -> ReaderT r m a -> ReaderT r m a
+ Control.Monad.Trans.Reader: local :: (Monad m) => (r -> r) -> ReaderT r m a -> ReaderT r m a
- Control.Monad.Trans.Reader: reader :: Monad m => (r -> a) -> ReaderT r m a
+ Control.Monad.Trans.Reader: reader :: (Monad m) => (r -> a) -> ReaderT r m a
- Control.Monad.Trans.State.Lazy: evalStateT :: Monad m => StateT s m a -> s -> m a
+ Control.Monad.Trans.State.Lazy: evalStateT :: (Monad m) => StateT s m a -> s -> m a
- Control.Monad.Trans.State.Lazy: execStateT :: Monad m => StateT s m a -> s -> m s
+ Control.Monad.Trans.State.Lazy: execStateT :: (Monad m) => StateT s m a -> s -> m s
- Control.Monad.Trans.State.Lazy: get :: Monad m => StateT s m s
+ Control.Monad.Trans.State.Lazy: get :: (Monad m) => StateT s m s
- Control.Monad.Trans.State.Lazy: gets :: Monad m => (s -> a) -> StateT s m a
+ Control.Monad.Trans.State.Lazy: gets :: (Monad m) => (s -> a) -> StateT s m a
- Control.Monad.Trans.State.Lazy: liftListen :: Monad m => Listen w m (a, s) -> Listen w (StateT s m) a
+ Control.Monad.Trans.State.Lazy: liftListen :: (Monad m) => Listen w m (a, s) -> Listen w (StateT s m) a
- Control.Monad.Trans.State.Lazy: liftPass :: Monad m => Pass w m (a, s) -> Pass w (StateT s m) a
+ Control.Monad.Trans.State.Lazy: liftPass :: (Monad m) => Pass w m (a, s) -> Pass w (StateT s m) a
- Control.Monad.Trans.State.Lazy: modify :: Monad m => (s -> s) -> StateT s m ()
+ Control.Monad.Trans.State.Lazy: modify :: (Monad m) => (s -> s) -> StateT s m ()
- Control.Monad.Trans.State.Lazy: modify' :: Monad m => (s -> s) -> StateT s m ()
+ Control.Monad.Trans.State.Lazy: modify' :: (Monad m) => (s -> s) -> StateT s m ()
- Control.Monad.Trans.State.Lazy: put :: Monad m => s -> StateT s m ()
+ Control.Monad.Trans.State.Lazy: put :: (Monad m) => s -> StateT s m ()
- Control.Monad.Trans.State.Lazy: state :: Monad m => (s -> (a, s)) -> StateT s m a
+ Control.Monad.Trans.State.Lazy: state :: (Monad m) => (s -> (a, s)) -> StateT s m a
- Control.Monad.Trans.State.Strict: evalStateT :: Monad m => StateT s m a -> s -> m a
+ Control.Monad.Trans.State.Strict: evalStateT :: (Monad m) => StateT s m a -> s -> m a
- Control.Monad.Trans.State.Strict: execStateT :: Monad m => StateT s m a -> s -> m s
+ Control.Monad.Trans.State.Strict: execStateT :: (Monad m) => StateT s m a -> s -> m s
- Control.Monad.Trans.State.Strict: get :: Monad m => StateT s m s
+ Control.Monad.Trans.State.Strict: get :: (Monad m) => StateT s m s
- Control.Monad.Trans.State.Strict: gets :: Monad m => (s -> a) -> StateT s m a
+ Control.Monad.Trans.State.Strict: gets :: (Monad m) => (s -> a) -> StateT s m a
- Control.Monad.Trans.State.Strict: liftListen :: Monad m => Listen w m (a, s) -> Listen w (StateT s m) a
+ Control.Monad.Trans.State.Strict: liftListen :: (Monad m) => Listen w m (a, s) -> Listen w (StateT s m) a
- Control.Monad.Trans.State.Strict: liftPass :: Monad m => Pass w m (a, s) -> Pass w (StateT s m) a
+ Control.Monad.Trans.State.Strict: liftPass :: (Monad m) => Pass w m (a, s) -> Pass w (StateT s m) a
- Control.Monad.Trans.State.Strict: modify :: Monad m => (s -> s) -> StateT s m ()
+ Control.Monad.Trans.State.Strict: modify :: (Monad m) => (s -> s) -> StateT s m ()
- Control.Monad.Trans.State.Strict: modify' :: Monad m => (s -> s) -> StateT s m ()
+ Control.Monad.Trans.State.Strict: modify' :: (Monad m) => (s -> s) -> StateT s m ()
- Control.Monad.Trans.State.Strict: put :: Monad m => s -> StateT s m ()
+ Control.Monad.Trans.State.Strict: put :: (Monad m) => s -> StateT s m ()
- Control.Monad.Trans.State.Strict: state :: Monad m => (s -> (a, s)) -> StateT s m a
+ Control.Monad.Trans.State.Strict: state :: (Monad m) => (s -> (a, s)) -> StateT s m a
- Control.Monad.Trans.Writer.Lazy: execWriterT :: Monad m => WriterT w m a -> m w
+ Control.Monad.Trans.Writer.Lazy: execWriterT :: (Monad m) => WriterT w m a -> m w
- Control.Monad.Trans.Writer.Lazy: liftCallCC :: Monoid w => CallCC m (a, w) (b, w) -> CallCC (WriterT w m) a b
+ Control.Monad.Trans.Writer.Lazy: liftCallCC :: (Monoid w) => CallCC m (a, w) (b, w) -> CallCC (WriterT w m) a b
- Control.Monad.Trans.Writer.Lazy: writer :: Monad m => (a, w) -> WriterT w m a
+ Control.Monad.Trans.Writer.Lazy: writer :: (Monad m) => (a, w) -> WriterT w m a
- Control.Monad.Trans.Writer.Strict: execWriterT :: Monad m => WriterT w m a -> m w
+ Control.Monad.Trans.Writer.Strict: execWriterT :: (Monad m) => WriterT w m a -> m w
- Control.Monad.Trans.Writer.Strict: liftCallCC :: Monoid w => CallCC m (a, w) (b, w) -> CallCC (WriterT w m) a b
+ Control.Monad.Trans.Writer.Strict: liftCallCC :: (Monoid w) => CallCC m (a, w) (b, w) -> CallCC (WriterT w m) a b
- Control.Monad.Trans.Writer.Strict: writer :: Monad m => (a, w) -> WriterT w m a
+ Control.Monad.Trans.Writer.Strict: writer :: (Monad m) => (a, w) -> WriterT w m a
- Data.Functor.Classes: class Eq1 f => Ord1 f
+ Data.Functor.Classes: class (Eq1 f) => Ord1 f
- Data.Functor.Classes: readsUnary :: Read a => String -> (a -> t) -> String -> ReadS t
+ Data.Functor.Classes: readsUnary :: (Read a) => String -> (a -> t) -> String -> ReadS t
- Data.Functor.Classes: showsUnary :: Show a => String -> Int -> a -> ShowS
+ Data.Functor.Classes: showsUnary :: (Show a) => String -> Int -> a -> ShowS

Files

Control/Applicative/Backwards.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif+----------------------------------------------------------------------------- -- | -- Module      :  Control.Applicative.Backwards -- Copyright   :  (c) Russell O'Connor 2009@@ -9,6 +14,7 @@ -- -- Making functors with an 'Applicative' instance that performs actions -- in the reverse order.+-----------------------------------------------------------------------------  module Control.Applicative.Backwards (     Backwards(..),
Control/Applicative/Lift.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif+----------------------------------------------------------------------------- -- | -- Module      :  Control.Applicative.Lift -- Copyright   :  (c) Ross Paterson 2010@@ -8,12 +13,16 @@ -- Portability :  portable -- -- Adding a new kind of pure computation to an applicative functor.+-----------------------------------------------------------------------------  module Control.Applicative.Lift (+    -- * Lifting an applicative     Lift(..),     unLift,+    mapLift,     -- * Collecting errors     Errors,+    runErrors,     failure   ) where @@ -85,11 +94,35 @@ unLift (Pure x) = pure x unLift (Other e) = e +-- | Apply a transformation to the other computation.+mapLift :: (f a -> g a) -> Lift f a -> Lift g a+mapLift f (Pure x) = Pure x+mapLift f (Other e) = Other (f e)+ -- | An applicative functor that collects a monoid (e.g. lists) of errors. -- A sequence of computations fails if any of its components do, but -- unlike monads made with 'ExceptT' from "Control.Monad.Trans.Except", -- these computations continue after an error, collecting all the errors.+--+-- * @'pure' f '<*>' 'pure' x = 'pure' (f x)@+--+-- * @'pure' f '<*>' 'failure' e = 'failure' e@+--+-- * @'failure' e '<*>' 'pure' x = 'failure' e@+--+-- * @'failure' e1 '<*>' 'failure' e2 = 'failure' (e1 '<>' e2)@+-- type Errors e = Lift (Constant e)++-- | Extractor for computations with accumulating errors.+--+-- * @'runErrors' ('pure' x) = 'Right' x@+--+-- * @'runErrors' ('failure' e) = 'Left' e@+--+runErrors :: Errors e a -> Either e a+runErrors (Other (Constant e)) = Left e+runErrors (Pure x) = Right x  -- | Report an error. failure :: (Monoid e) => e -> Errors e a
Control/Monad/IO/Class.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.IO.Class
Control/Monad/Trans/Class.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.Class
Control/Monad/Trans/Cont.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.Cont
Control/Monad/Trans/Error.hs view
@@ -1,4 +1,7 @@ {-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- |
Control/Monad/Trans/Except.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.Except@@ -57,8 +61,9 @@ -- -- Computations are either exceptions or normal values. ----- The 'return' function returns a normal value, while @>>=@ exits--- on the first exception.+-- The 'return' function returns a normal value, while @>>=@ exits on+-- the first exception.  For a variant that continies after an error+-- and collects all the errors, see 'Control.Applicative.Lift.Errors'. type Except e = ExceptT e Identity  -- | Constructor for computations in the exception monad.@@ -175,9 +180,8 @@             Right x -> return (Right x)  instance (MonadFix m) => MonadFix (ExceptT e m) where-    mfix f = ExceptT $ mfix $ \ a -> runExceptT $ f $ case a of-        Right x -> x-        Left _ -> error "mfix ExceptT: Left"+    mfix f = ExceptT (mfix (runExceptT . f . either (const bomb) id))+      where bomb = error "mfix (ExceptT): inner computation returned Left value"  instance MonadTrans (ExceptT e) where     lift = ExceptT . liftM Right
Control/Monad/Trans/Identity.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.Identity
Control/Monad/Trans/List.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.List
Control/Monad/Trans/Maybe.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.Maybe@@ -124,8 +128,8 @@             Just _  -> return v  instance (MonadFix m) => MonadFix (MaybeT m) where-    mfix f = MaybeT (mfix (runMaybeT . f . unJust))-      where unJust = fromMaybe (error "mfix MaybeT: Nothing")+    mfix f = MaybeT (mfix (runMaybeT . f . fromMaybe bomb))+      where bomb = error "mfix (MaybeT): inner computation returned Nothing"  instance MonadTrans MaybeT where     lift = MaybeT . liftM Just
Control/Monad/Trans/RWS/Lazy.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.RWS.Lazy
Control/Monad/Trans/RWS/Strict.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.RWS.Strict
Control/Monad/Trans/Reader.hs view
@@ -1,4 +1,7 @@ {-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.Reader
Control/Monad/Trans/State/Lazy.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.State.Lazy
Control/Monad/Trans/State/Strict.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.State.Strict
Control/Monad/Trans/Writer/Lazy.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.Writer.Lazy
Control/Monad/Trans/Writer/Strict.hs view
@@ -1,3 +1,7 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Trans.Writer.Strict
Data/Functor/Classes.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif+----------------------------------------------------------------------------- -- | -- Module      :  Data.Functor.Classes -- Copyright   :  (c) Ross Paterson 2013@@ -8,6 +13,7 @@ -- Portability :  portable -- -- Prelude classes, lifted to unary type constructors.+-----------------------------------------------------------------------------  module Data.Functor.Classes (     -- * Liftings of Prelude classes@@ -25,6 +31,8 @@     showsBinary1,   ) where +import Data.Functor.Identity+ -- | Lifting of the 'Eq' class to unary type constructors. class Eq1 f where     eq1 :: (Eq a) => f a -> f a -> Bool@@ -62,6 +70,13 @@ instance (Ord a) => Ord1 (Either a) where compare1 = compare instance (Read a) => Read1 (Either a) where readsPrec1 = readsPrec instance (Show a) => Show1 (Either a) where showsPrec1 = showsPrec++-- Instances for other functors++instance Eq1 Identity where eq1 = (==)+instance Ord1 Identity where compare1 = compare+instance Read1 Identity where readsPrec1 = readsPrec+instance Show1 Identity where showsPrec1 = showsPrec  -- Building blocks 
Data/Functor/Compose.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif+----------------------------------------------------------------------------- -- | -- Module      :  Data.Functor.Compose -- Copyright   :  (c) Ross Paterson 2010@@ -8,6 +13,7 @@ -- Portability :  portable -- -- Composition of functors.+-----------------------------------------------------------------------------  module Data.Functor.Compose (     Compose(..),
Data/Functor/Constant.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif+----------------------------------------------------------------------------- -- | -- Module      :  Data.Functor.Constant -- Copyright   :  (c) Ross Paterson 2010@@ -8,6 +13,7 @@ -- Portability :  portable -- -- The constant functor.+-----------------------------------------------------------------------------  module Data.Functor.Constant (     Constant(..),
− Data/Functor/Identity.hs
@@ -1,73 +0,0 @@--- |--- Module      :  Data.Functor.Identity--- Copyright   :  (c) Andy Gill 2001,---                (c) Oregon Graduate Institute of Science and Technology 2001--- License     :  BSD-style (see the file LICENSE)------ Maintainer  :  ross@soi.city.ac.uk--- Stability   :  experimental--- Portability :  portable------ The identity functor and monad.------ This trivial type constructor serves two purposes:------ * It can be used with functions parameterized by functor or monad classes.------ * It can be used as a base monad to which a series of monad---   transformers may be applied to construct a composite monad.---   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'@.--module Data.Functor.Identity (-    Identity(..),-  ) where--import Data.Functor.Classes--import Control.Applicative-import Control.Monad.Fix-import Data.Foldable (Foldable(foldMap))-import Data.Traversable (Traversable(traverse))---- | Identity functor and monad. (a non-strict monad)-newtype Identity a = Identity { runIdentity :: a }-    deriving (Eq, Ord)---- These instances would be equivalent to the derived instances of the--- newtype if the field were removed.--instance (Read a) => Read (Identity a) where-    readsPrec = readsData $ readsUnary "Identity" Identity--instance (Show a) => Show (Identity a) where-    showsPrec d (Identity x) = showsUnary "Identity" d x--instance Eq1 Identity where eq1 = (==)-instance Ord1 Identity where compare1 = compare-instance Read1 Identity where readsPrec1 = readsPrec-instance Show1 Identity where showsPrec1 = showsPrec---- ------------------------------------------------------------------------------ Identity instances for Functor and Monad--instance Functor Identity where-    fmap f m = Identity (f (runIdentity m))--instance Foldable Identity where-    foldMap f (Identity x) = f x--instance Traversable Identity where-    traverse f (Identity x) = Identity <$> f x--instance Applicative Identity where-    pure a = Identity a-    Identity f <*> Identity x = Identity (f x)--instance Monad Identity where-    return a = Identity a-    m >>= k  = k (runIdentity m)--instance MonadFix Identity where-    mfix f = Identity (fix (runIdentity . f))
Data/Functor/Product.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif+----------------------------------------------------------------------------- -- | -- Module      :  Data.Functor.Product -- Copyright   :  (c) Ross Paterson 2010@@ -8,6 +13,7 @@ -- Portability :  portable -- -- Products, lifted to functors.+-----------------------------------------------------------------------------  module Data.Functor.Product (     Product(..),
Data/Functor/Reverse.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif+----------------------------------------------------------------------------- -- | -- Module      :  Data.Functor.Reverse -- Copyright   :  (c) Russell O'Connor 2009@@ -9,6 +14,7 @@ -- -- Making functors whose elements are notionally in the reverse order -- from the original functor.+-----------------------------------------------------------------------------  module Data.Functor.Reverse (     Reverse(..),
Data/Functor/Sum.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 709+{-# LANGUAGE AutoDeriveTypeable #-}+#endif+----------------------------------------------------------------------------- -- | -- Module      :  Data.Functor.Sum -- Copyright   :  (c) Ross Paterson 2014@@ -8,6 +13,7 @@ -- Portability :  portable -- -- Sums, lifted to functors.+-----------------------------------------------------------------------------  module Data.Functor.Sum (     Sum(..),
changelog view
@@ -1,5 +1,12 @@ -*-change-log-*- +0.4.2.0 Ross Paterson <ross@soi.city.ac.uk> Nov 2014+	* Dropped compatibility with base-1.x+	* Data.Functor.Identity in base for GHC >= 7.10+	* Added mapLift and runErrors to Control.Applicative.Lift+	* Added AutoDeriveTypeable for GHC >= 7.10+	* Expanded messages from mfix on ExceptT and MaybeT+ 0.4.1.0 Ross Paterson <ross@soi.city.ac.uk> May 2014 	* Reverted to record syntax for newtypes until next major release 
+ oldsrc/Data/Functor/Identity.hs view
@@ -0,0 +1,70 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Functor.Identity+-- Copyright   :  (c) Andy Gill 2001,+--                (c) Oregon Graduate Institute of Science and Technology 2001+-- License     :  BSD-style (see the file LICENSE)+--+-- Maintainer  :  ross@soi.city.ac.uk+-- Stability   :  experimental+-- Portability :  portable+--+-- The identity functor and monad.+--+-- This trivial type constructor serves two purposes:+--+-- * It can be used with functions parameterized by functor or monad classes.+--+-- * It can be used as a base monad to which a series of monad+--   transformers may be applied to construct a composite monad.+--   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'@.+-----------------------------------------------------------------------------++module Data.Functor.Identity (+    Identity(..),+  ) where++import Control.Applicative+import Control.Monad.Fix+import Data.Foldable (Foldable(foldMap))+import Data.Traversable (Traversable(traverse))++-- | Identity functor and monad. (a non-strict monad)+newtype Identity a = Identity { runIdentity :: a }+    deriving (Eq, Ord)++-- These instances would be equivalent to the derived instances of the+-- newtype if the field were removed.++instance (Read a) => Read (Identity a) where+    readsPrec d = readParen (d > 10) $ \ r ->+        [(Identity x,t) | ("Identity",s) <- lex r, (x,t) <- readsPrec 11 s]++instance (Show a) => Show (Identity a) where+    showsPrec d (Identity x) = showParen (d > 10) $+        showString "Identity " . showsPrec 11 x++-- ---------------------------------------------------------------------------+-- Identity instances for Functor and Monad++instance Functor Identity where+    fmap f m = Identity (f (runIdentity m))++instance Foldable Identity where+    foldMap f (Identity x) = f x++instance Traversable Identity where+    traverse f (Identity x) = Identity <$> f x++instance Applicative Identity where+    pure a = Identity a+    Identity f <*> Identity x = Identity (f x)++instance Monad Identity where+    return a = Identity a+    m >>= k  = k (runIdentity m)++instance MonadFix Identity where+    mfix f = Identity (fix (runIdentity . f))
transformers.cabal view
@@ -1,5 +1,5 @@ name:         transformers-version:      0.4.1.0+version:      0.4.2.0 license:      BSD3 license-file: LICENSE author:       Andy Gill, Ross Paterson@@ -37,15 +37,15 @@   type: darcs   location: http://code.haskell.org/~ross/transformers -flag ApplicativeInBase-  description: Use the current base package, including Applicative and-    other Functor classes.- library-  if flag(ApplicativeInBase)-    build-depends: base >= 2 && < 6-  else-    build-depends: base >= 1.0 && < 2, special-functors >= 1.0 && < 1.1+  build-depends: base >= 2 && < 6+  hs-source-dirs: .+  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: oldsrc+    exposed-modules: Data.Functor.Identity   exposed-modules:     Control.Applicative.Backwards     Control.Applicative.Lift@@ -71,7 +71,6 @@     Data.Functor.Classes     Data.Functor.Compose     Data.Functor.Constant-    Data.Functor.Identity     Data.Functor.Product     Data.Functor.Reverse     Data.Functor.Sum