microlens-mtl 0.2.0.1 → 0.2.0.2
raw patch · 2 files changed
+26/−13 lines, 2 filesdep ~mtldep ~transformersnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: mtl, transformers
API changes (from Hackage documentation)
Files
- microlens-mtl.cabal +10/−7
- src/Lens/Micro/Mtl/Internal.hs +16/−6
microlens-mtl.cabal view
@@ -1,5 +1,5 @@ name: microlens-mtl-version: 0.2.0.1+version: 0.2.0.2 synopsis: microlens support for Reader/Writer/State from mtl description: This package contains functions (like 'view' or '+=') which work on 'MonadReader', 'MonadWriter', and 'MonadState' from the mtl package.@@ -8,7 +8,7 @@ license: BSD3 license-file: LICENSE author: Edward Kmett, Artyom Kazak-maintainer: Monadfix <hi@monadfix.io>+maintainer: Monadfix <hi@monadfix.com> homepage: http://github.com/monadfix/microlens bug-reports: http://github.com/monadfix/microlens/issues -- copyright:@@ -17,14 +17,17 @@ extra-source-files: CHANGELOG.md cabal-version: >=1.10-tested-with: GHC==7.4.2- GHC==7.6.3+tested-with: GHC==7.6.3 GHC==7.8.4 GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 GHC==8.4.4- GHC==8.6.4+ GHC==8.6.5+ GHC==8.8.4+ GHC==8.10.7+ GHC==9.0.1+ GHC==9.2.1 source-repository head type: git@@ -36,8 +39,8 @@ -- other-extensions: build-depends: base >=4.5 && <5 , microlens >=0.4 && <0.5- , mtl >=2.0.1 && <2.3- , transformers >=0.2 && <0.6+ , mtl >=2.0.1 && <2.4+ , transformers >=0.2 && <0.7 , transformers-compat >=0.4 && <1 ghc-options:
src/Lens/Micro/Mtl/Internal.hs view
@@ -51,6 +51,10 @@ import Control.Applicative+#if MIN_VERSION_mtl(2, 3, 0)+import Control.Monad (liftM, liftM2)+#else+#endif import Control.Monad.Reader as Reader import Control.Monad.State as State import Control.Monad.Trans.State.Lazy as Lazy@@ -59,9 +63,11 @@ import Control.Monad.Trans.Writer.Strict as Strict import Control.Monad.Trans.RWS.Lazy as Lazy import Control.Monad.Trans.RWS.Strict as Strict+#if !MIN_VERSION_transformers(0, 6, 0) import Control.Monad.Trans.Error-import Control.Monad.Trans.Except import Control.Monad.Trans.List+#endif+import Control.Monad.Trans.Except import Control.Monad.Trans.Identity import Control.Monad.Trans.Maybe -- microlens@@ -87,9 +93,11 @@ type instance Zoomed (Lazy.RWST r w s z) = FocusingWith w z type instance Zoomed (Strict.WriterT w m) = FocusingPlus w (Zoomed m) type instance Zoomed (Lazy.WriterT w m) = FocusingPlus w (Zoomed m)+#if !MIN_VERSION_transformers(0, 6, 0) type instance Zoomed (ListT m) = FocusingOn [] (Zoomed m)-type instance Zoomed (MaybeT m) = FocusingMay (Zoomed m) type instance Zoomed (ErrorT e m) = FocusingErr e (Zoomed m)+#endif+type instance Zoomed (MaybeT m) = FocusingMay (Zoomed m) type instance Zoomed (ExceptT e m) = FocusingErr e (Zoomed m) ------------------------------------------------------------------------------@@ -386,16 +394,18 @@ zoom l = Lazy.WriterT . zoom (\afb -> unfocusingPlus #. l (FocusingPlus #. afb)) . Lazy.runWriterT {-# INLINE zoom #-} +#if !MIN_VERSION_mtl(2, 3, 0) && !MIN_VERSION_transformers(0, 6, 0) instance Zoom m n s t => Zoom (ListT m) (ListT n) s t where zoom l = ListT . zoom (\afb -> unfocusingOn . l (FocusingOn . afb)) . runListT {-# INLINE zoom #-} -instance Zoom m n s t => Zoom (MaybeT m) (MaybeT n) s t where- zoom l = MaybeT . liftM getMay . zoom (\afb -> unfocusingMay #. l (FocusingMay #. afb)) . liftM May . runMaybeT- {-# INLINE zoom #-}- instance (Error e, Zoom m n s t) => Zoom (ErrorT e m) (ErrorT e n) s t where zoom l = ErrorT . liftM getErr . zoom (\afb -> unfocusingErr #. l (FocusingErr #. afb)) . liftM Err . runErrorT+ {-# INLINE zoom #-}+#endif++instance Zoom m n s t => Zoom (MaybeT m) (MaybeT n) s t where+ zoom l = MaybeT . liftM getMay . zoom (\afb -> unfocusingMay #. l (FocusingMay #. afb)) . liftM May . runMaybeT {-# INLINE zoom #-} instance Zoom m n s t => Zoom (ExceptT e m) (ExceptT e n) s t where