lens 4.0.2 → 4.0.3
raw patch · 8 files changed
+23/−2 lines, 8 files
Files
- CHANGELOG.markdown +4/−0
- lens.cabal +1/−1
- src/Control/Lens/At.hs +5/−0
- src/Control/Lens/Internal/Fold.hs +1/−1
- src/Data/ByteString/Lazy/Lens.hs +3/−0
- src/Data/ByteString/Strict/Lens.hs +3/−0
- src/Data/Text/Lazy/Lens.hs +3/−0
- src/Data/Text/Strict/Lens.hs +3/−0
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+4.0.3+-----+* Fixed random segfaulting when using `foldMapBy`.+ 4.0.2 ----- * Properly bundled the modules needed for the properties test suite into the tarball for hackage.
lens.cabal view
@@ -1,6 +1,6 @@ name: lens category: Data, Lenses, Generics-version: 4.0.2+version: 4.0.3 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE
src/Control/Lens/At.hs view
@@ -181,6 +181,11 @@ ixAt i = at i . traverse {-# INLINE ixAt #-} +type instance IxValue (e -> a) = a+instance Eq e => Ixed (e -> a) where+ ix e p f = p (f e) <&> \a e' -> if e == e' then a else f e'+ {-# INLINE ix #-}+ type instance IxValue (Maybe a) = a instance Ixed (Maybe a) where ix () f (Just a) = Just <$> f a
src/Control/Lens/Internal/Fold.hs view
@@ -223,7 +223,7 @@ reflectResult :: Reifies s a => (a -> f s) -> f s reflectResult f = let r = f (reflect r) in r -data M a s = M a+newtype M a s = M a unM :: M a s -> proxy s -> a unM (M a) _ = a
src/Data/ByteString/Lazy/Lens.hs view
@@ -67,6 +67,9 @@ -- -- >>> anyOf bytes (== 0x80) (Char8.pack "hello") -- False+--+-- Note that when just using this as a 'Setter', @'setting' 'Data.ByteString.Lazy.map'@+-- can be more efficient. bytes :: IndexedTraversal' Int64 ByteString Word8 bytes = traversedLazy {-# INLINE bytes #-}
src/Data/ByteString/Strict/Lens.hs view
@@ -66,6 +66,9 @@ -- -- >>> anyOf bytes (== 0x80) (Char8.pack "hello") -- False+--+-- Note that when just using this as a 'Setter', @'setting' 'Data.ByteString.map'@+-- can be more efficient. bytes :: IndexedTraversal' Int ByteString Word8 bytes = traversedStrictTree 0 {-# INLINE bytes #-}
src/Data/Text/Lazy/Lens.hs view
@@ -87,6 +87,9 @@ -- @ -- 'text' ≡ 'each' -- @+--+-- Note that when just using this as a 'Setter', @'setting' 'Data.Text.Lazy.map'@+-- can be more efficient. text :: IndexedTraversal' Int Text Char text = unpacked . traversed {-# INLINE text #-}
src/Data/Text/Strict/Lens.hs view
@@ -86,6 +86,9 @@ -- 'text' ≡ 'unpacked' . 'traversed' -- 'text' ≡ 'each' -- @+--+-- Note that when just using this as a 'Setter', @'setting' 'Data.Text.map'@ can+-- be more efficient. text :: IndexedTraversal' Int Text Char text = unpacked . traversed {-# INLINE text #-}