packages feed

lens 3.7.1.2 → 3.7.2

raw patch · 4 files changed

+18/−5 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Control.Lens.Zoom: class (MonadReader b m, MonadReader a n) => Magnify m n k b a | m -> b, n -> a, m a -> n, n b -> m
+ Control.Lens.Zoom: class (MonadReader b m, MonadReader a n) => Magnify m n k b a | m -> b k, n -> a k, m a -> n, n b -> m

Files

.travis.yml view
@@ -1,7 +1,7 @@ language: haskell before_install:   # Uncomment whenever hackage is down.-  - mkdir -p ~/.cabal && cp config ~/.cabal/config && cabal update+  # - mkdir -p ~/.cabal && cp config ~/.cabal/config && cabal update    # Try installing some of the build-deps with apt-get for speed.   - ./travis-cabal-apt-install --only-dependencies --force-reinstall $mode
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+3.7.2 [maintenance release]+-----+* Bug fix for `Magnify`. It was missing functional dependencies to determine its `k` parameter from `m` or `n`.+ 3.7.1.2 [maintenance release] ------- * Made the doctest test suite hide all but the exact versions of packages used to build this package to avoid problems with complicated user environments.
lens.cabal view
@@ -1,6 +1,6 @@ name:          lens category:      Data, Lenses-version:       3.7.1.2+version:       3.7.2 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE
src/Control/Lens/Zoom.hs view
@@ -31,7 +31,7 @@ import Control.Lens.Internal.Combinators import Control.Lens.Type import Control.Monad-import Control.Monad.Reader.Class as Reader+import Control.Monad.Reader as Reader import Control.Monad.State as State import Control.Monad.Trans.State.Lazy as Lazy import Control.Monad.Trans.State.Strict as Strict@@ -39,7 +39,6 @@ import Control.Monad.Trans.Writer.Strict as Strict import Control.Monad.Trans.RWS.Lazy as Lazy import Control.Monad.Trans.RWS.Strict as Strict-import Control.Monad.Trans.Reader import Control.Monad.Trans.Error import Control.Monad.Trans.List import Control.Monad.Trans.Identity@@ -48,6 +47,7 @@  -- $setup -- >>> import Control.Lens+-- >>> import Data.List.Lens (_tail) -- >>> import Control.Monad.State -- >>> import Data.Map as Map -- >>> import Debug.SimpleReflect.Expr as Expr@@ -151,7 +151,7 @@ -- many different monad transformers. Unlike 'zoom' this can change the environment of a deeply nested monad transformer. -- -- Also, unlike 'zoom', this can be used with any valid 'Getter', but cannot be used with a 'Traversal' or 'Fold'.-class (MonadReader b m, MonadReader a n) => Magnify m n k b a | m -> b, n -> a, m a -> n, n b -> m where+class (MonadReader b m, MonadReader a n) => Magnify m n k b a | m -> b k, n -> a k, m a -> n, n b -> m where   -- | Run a monadic action in a larger environment than it was defined in, using a 'Getter'.   --   -- This acts like 'Control.Monad.Reader.Class.local', but can in many cases change the type of the environment as well.@@ -159,6 +159,15 @@   -- This is commonly used to lift actions in a simpler Reader monad into a monad with a larger environment type.   --   -- This can be used to edit pretty much any monad transformer stack with an environment in it:+  --+  -- >>> (1,2) & magnify _2 (+1)+  -- 3+  --+  -- >>> flip Reader.runReader (1,2) $ magnify _1 Reader.ask+  -- 1+  --+  -- >>> flip Reader.runReader (1,2,[10..20]) $ magnify (_3._tail) Reader.ask+  -- [11,12,13,14,15,16,17,18,19,20]   --   -- @   -- 'magnify' ::             'Getter' s a -> (a -> r) -> s -> r