lenz 0.4.0.0 → 0.4.1.0
raw patch · 2 files changed
+9/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Lens: constL :: Iso (Const a α) (Const b β) a b
+ Control.Lens: invert :: AnIso α β a b -> Iso b a β α
Files
- Control/Lens.hs +8/−2
- lenz.cabal +1/−1
Control/Lens.hs view
@@ -1,8 +1,8 @@ module Control.Lens (Lens, Traversal, Iso,- lens, iso,+ lens, iso, invert, get, set, modify, mapping, toListOf, foldrOf, foldlOf, mapAccumLOf, mapAccumROf,- fstL, sndL, swapL, unitL, bitL) where+ fstL, sndL, swapL, unitL, bitL, constL) where import Prelude hiding (id) @@ -48,6 +48,9 @@ withIso :: AnIso α β a b -> ((α -> a) -> (b -> β) -> c) -> c withIso x = case x (Xchg id Identity) of Xchg φ χ -> \ f -> f φ (runIdentity ∘ χ) +invert :: AnIso α β a b -> Iso b a β α+invert = flip withIso $ flip iso+ type AnIso α β a b = Xchg a b a (Identity b) -> Xchg a b α (Identity β) data Xchg a b α β = Xchg (α -> a) (b -> β) deriving (Functor)@@ -94,3 +97,6 @@ bitL :: Bits a => Int -> Lens a a Bool Bool bitL = liftA2 lens (flip testBit) (flip (flip ∘ bool clearBit setBit))++constL :: Iso (Const a α) (Const b β) a b+constL = iso getConst Const
lenz.cabal view
@@ -1,5 +1,5 @@ name: lenz-version: 0.4.0.0+version: 0.4.1.0 synopsis: Van Laarhoven lenses license: BSD3 author: M Farkas-Dyck