packages feed

data-lens-light 0.1.1 → 0.1.2

raw patch · 3 files changed

+15/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Lens.Light: vanLaarhoven :: Functor f => Lens a b -> (b -> f b) -> (a -> f a)

Files

CHANGELOG.md view
@@ -1,6 +1,11 @@ Changes ======= +Version 0.1.2+-------------++Add `vanLaarhoven`+ Version 0.1.1 ------------- 
data-lens-light.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                data-lens-light-version:             0.1.1+version:             0.1.2 synopsis:            Simple lenses, minimum dependencies description:         See <https://github.com/feuerbach/data-lens-light/blob/master/README.md> homepage:            https://github.com/feuerbach/data-lens-light
src/Data/Lens/Light/Core.hs view
@@ -7,6 +7,7 @@   , modL   , modL'   , (^.)+  , vanLaarhoven   )   where @@ -55,3 +56,11 @@ infixl 9 ^. (^.) :: b -> Lens b c -> c (^.) = flip getL++-- | Convert a lens to its van Laarhoven representation+vanLaarhoven :: Functor f => Lens a b -> (b -> f b) -> (a -> f a)+vanLaarhoven l f a =+  let+    fb = f (a ^. l)+    fa = fmap (\b -> setL l b a) fb+  in fa