microlens-platform 0.1.5.0 → 0.1.6.0
raw patch · 3 files changed
+12/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Lens.Micro.Platform: instance (GHC.Classes.Eq k, Data.Hashable.Class.Hashable k) => Lens.Micro.Internal.At (Data.HashMap.Base.HashMap k a)
Files
- CHANGELOG.md +4/−0
- microlens-platform.cabal +1/−1
- src/Lens/Micro/Platform.hs +7/−0
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.1.6.0++* A missing instance of `At` for `HashMap` has been added.+ # 0.1.5.0 * New minor release (microlens-mtl-0.1.6).
microlens-platform.cabal view
@@ -1,5 +1,5 @@ name: microlens-platform-version: 0.1.5.0+version: 0.1.6.0 synopsis: Feature-complete microlens description: This package exports a module which is the recommended starting point for using <http://hackage.haskell.org/package/microlens microlens> if you aren't trying to keep your dependencies minimal. By importing @Lens.Micro.Platform@ you get all functions and instances from <http://hackage.haskell.org/package/microlens microlens>, <http://hackage.haskell.org/package/microlens-th microlens-th>, <http://hackage.haskell.org/package/microlens-mtl microlens-mtl>, <http://hackage.haskell.org/package/microlens-ghc microlens-ghc>, as well as instances for @Vector@, @Text@, and @HashMap@.
src/Lens/Micro/Platform.hs view
@@ -91,6 +91,13 @@ Nothing -> pure m {-# INLINE ix #-} +instance (Eq k, Hashable k) => At (HashMap k a) where+ at k f m = f mv <&> \r -> case r of+ Nothing -> maybe m (const (HashMap.delete k m)) mv+ Just v' -> HashMap.insert k v' m+ where mv = HashMap.lookup k m+ {-# INLINE at #-}+ instance Ixed (Vector.Vector a) where ix i f v | 0 <= i && i < Vector.length v = f (v Vector.! i) <&> \a -> v Vector.// [(i, a)]