either 4.3.2 → 4.3.2.1
raw patch · 3 files changed
+27/−3 lines, 3 filesdep ~monad-controlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: monad-control
API changes (from Hackage documentation)
Files
- CHANGELOG.markdown +4/−0
- either.cabal +2/−2
- src/Control/Monad/Trans/Either.hs +21/−1
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+4.3.2.1+-------+* Support `monad-control` 1.0+ 4.3.2 ----- * Added `Validation`.
either.cabal view
@@ -1,6 +1,6 @@ name: either category: Control, Monads-version: 4.3.2+version: 4.3.2.1 license: BSD3 cabal-version: >= 1.6 license-file: LICENSE@@ -31,7 +31,7 @@ bifunctors >= 4 && < 5, exceptions >= 0.5 && < 0.7, free >= 4.9 && < 5,- monad-control >= 0.3.2 && < 0.4,+ monad-control >= 0.3.2 && < 1.1, MonadRandom >= 0.1 && < 0.4, mtl >= 2.0 && < 2.3, profunctors >= 4 && < 5,
src/Control/Monad/Trans/Either.hs view
@@ -287,16 +287,36 @@ liftBase = liftBaseDefault {-# INLINE liftBase #-} +#if MIN_VERSION_monad_control(1,0,0)+ instance MonadTransControl (EitherT e) where+ type StT (EitherT e) a = Either e a+ liftWith f = EitherT $ liftM return $ f runEitherT+ {-# INLINE liftWith #-}+ restoreT = EitherT+ {-# INLINE restoreT #-}++instance MonadBaseControl b m => MonadBaseControl b (EitherT e m) where+ type StM (EitherT e m) a = StM m (StT (EitherT e) a)+ liftBaseWith = defaultLiftBaseWith+ {-# INLINE liftBaseWith #-}+ restoreM = defaultRestoreM+ {-# INLINE restoreM #-}++#else++instance MonadTransControl (EitherT e) where newtype StT (EitherT e) a = StEitherT {unStEitherT :: Either e a} liftWith f = EitherT $ liftM return $ f $ liftM StEitherT . runEitherT {-# INLINE liftWith #-} restoreT = EitherT . liftM unStEitherT {-# INLINE restoreT #-}-+ instance MonadBaseControl b m => MonadBaseControl b (EitherT e m) where newtype StM (EitherT e m) a = StMEitherT { unStMEitherT :: StM m (StT (EitherT e) a) } liftBaseWith = defaultLiftBaseWith StMEitherT {-# INLINE liftBaseWith #-} restoreM = defaultRestoreM unStMEitherT {-# INLINE restoreM #-}++#endif