insert-ordered-containers 0.2.5.3 → 0.2.6
raw patch · 4 files changed
+27/−81 lines, 4 filesdep ~QuickCheckdep ~aesondep ~base
Dependency ranges changed: QuickCheck, aeson, base, deepseq, hashable, indexed-traversable, lens, optics-core, optics-extra, semigroupoids, tasty-quickcheck, transformers, unordered-containers
Files
- CHANGELOG.md +3/−0
- insert-ordered-containers.cabal +24/−25
- src/Data/HashMap/Strict/InsOrd.hs +0/−43
- src/Data/HashSet/InsOrd.hs +0/−13
CHANGELOG.md view
@@ -1,3 +1,6 @@+- 0.2.6+ - Support GHC-8.6.5...9.10.1+ - 0.2.5.3 - Support `aeson-2.2` - Make `Prelude` import explicit (safe guard against additions to `Prelude`).
insert-ordered-containers.cabal view
@@ -1,5 +1,6 @@+cabal-version: 2.2 name: insert-ordered-containers-version: 0.2.5.3+version: 0.2.6 synopsis: Associative containers retaining insertion order for traversals. @@ -13,21 +14,19 @@ bug-reports: https://github.com/phadej/insert-ordered-containers/issues author: Oleg Grenrus <oleg.grenrus@iki.fi> maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>-license: BSD3+license: BSD-3-Clause license-file: LICENSE build-type: Simple-cabal-version: >=1.10 tested-with:- GHC ==8.0.2- || ==8.2.2- || ==8.4.4- || ==8.6.5+ GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8- || ==9.4.5- || ==9.6.2+ || ==9.4.8+ || ==9.6.6+ || ==9.8.2+ || ==9.10.1 extra-source-files: CHANGELOG.md@@ -42,18 +41,18 @@ hs-source-dirs: src ghc-options: -Wall build-depends:- aeson >=1.4.2.0 && <1.6 || >=2.0.0.0 && <2.3- , base >=4.9 && <4.19- , deepseq >=1.4.2.0 && <1.5- , hashable >=1.2.6.1 && <1.5- , indexed-traversable >=0.1.1 && <0.2- , lens >=4.17 && <5.3- , optics-core >=0.2 && <0.5- , optics-extra >=0.2 && <0.5- , semigroupoids >=5.3.2 && <6.1- , text >=1.2.3.0 && <1.3 || >=2.0 && <2.1- , transformers >=0.5.2.0 && <0.7- , unordered-containers >=0.2.14.0 && <0.3+ , aeson >=2.2.3.0 && <2.3+ , base >=4.12.0.0 && <4.21+ , deepseq >=1.4.4.0 && <1.6+ , hashable >=1.4.7.0 && <1.5+ , indexed-traversable >=0.1.4 && <0.2+ , lens >=5.2.3 && <5.4+ , optics-core >=0.4.1.1 && <0.5+ , optics-extra >=0.4.2.1 && <0.5+ , semigroupoids >=6.0.1 && <6.1+ , text >=1.2.3.0 && <1.3 || >=2.0 && <2.2+ , transformers >=0.5.6.2 && <0.7+ , unordered-containers >=0.2.20 && <0.3 exposed-modules: Data.HashMap.Strict.InsOrd@@ -70,15 +69,15 @@ -- inherited from library build-depends:- aeson+ , aeson , base , base-compat , hashable , insert-ordered-containers , lens- , QuickCheck >=2.13.2 && <2.15+ , QuickCheck >=2.13.2 && <2.16 , semigroupoids- , tasty >=0.10.1.2 && <1.5- , tasty-quickcheck >=0.8.3.2 && <0.11+ , tasty >=0.10.1.2 && <1.6+ , tasty-quickcheck >=0.8.3.2 && <0.12 , text , unordered-containers
src/Data/HashMap/Strict/InsOrd.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-}@@ -120,9 +119,7 @@ import qualified GHC.Exts as Exts -#if MIN_VERSION_deepseq(1,4,3) import qualified Control.DeepSeq as NF-#endif import Data.HashMap.InsOrd.Internal @@ -136,11 +133,9 @@ instance NFData a => NFData (P a) where rnf (P _ a) = rnf a -#if MIN_VERSION_deepseq(1,4,3) -- | @since 0.2.5 instance NF.NFData1 P where liftRnf rnf1 (P _ a) = rnf1 a-#endif getPK :: P a -> Int getPK (P i _) = i@@ -179,7 +174,6 @@ instance (NFData k, NFData v) => NFData (InsOrdHashMap k v) where rnf (InsOrdHashMap _ hm) = rnf hm -#if MIN_VERSION_deepseq(1,4,3) -- | @since 0.2.5 instance NFData k => NF.NFData1 (InsOrdHashMap k) where liftRnf rnf2 = NF.liftRnf2 rnf rnf2@@ -187,7 +181,6 @@ -- | @since 0.2.5 instance NF.NFData2 InsOrdHashMap where liftRnf2 rnf1 rnf2 (InsOrdHashMap _ m) = NF.liftRnf2 rnf1 (NF.liftRnf rnf2) m-#endif instance (Eq k, Eq v) => Eq (InsOrdHashMap k v) where InsOrdHashMap _ a == InsOrdHashMap _ b = a == b@@ -247,25 +240,13 @@ ------------------------------------------------------------------------------- instance (A.ToJSONKey k) => A.ToJSON1 (InsOrdHashMap k) where-#if MIN_VERSION_aeson(2,2,0) liftToJSON _ t _ = case A.toJSONKey :: A.ToJSONKeyFunction k of A.ToJSONKeyText f _ -> A.object . fmap (\(k, v) -> (f k, t v)) . toList A.ToJSONKeyValue f _ -> A.toJSON . fmap (\(k,v) -> A.toJSON (f k, t v)) . toList-#else- liftToJSON t _ = case A.toJSONKey :: A.ToJSONKeyFunction k of- A.ToJSONKeyText f _ -> A.object . fmap (\(k, v) -> (f k, t v)) . toList- A.ToJSONKeyValue f _ -> A.toJSON . fmap (\(k,v) -> A.toJSON (f k, t v)) . toList-#endif -#if MIN_VERSION_aeson(2,2,0) liftToEncoding o t _ = case A.toJSONKey :: A.ToJSONKeyFunction k of A.ToJSONKeyText _ f -> E.dict f t foldrWithKey A.ToJSONKeyValue _ f -> E.list (A.liftToEncoding2 (const False) f (E.list f) o t (E.list t)) . toList-#else- liftToEncoding t _ = case A.toJSONKey :: A.ToJSONKeyFunction k of- A.ToJSONKeyText _ f -> E.dict f t foldrWithKey- A.ToJSONKeyValue _ f -> E.list (A.liftToEncoding2 f (E.list f) t (E.list t)) . toList-#endif instance (A.ToJSONKey k, A.ToJSON v) => A.ToJSON (InsOrdHashMap k v) where toJSON = A.toJSON1@@ -274,11 +255,7 @@ ------------------------------------------------------------------------------- instance (Eq k, Hashable k, A.FromJSONKey k) => A.FromJSON1 (InsOrdHashMap k) where-#if MIN_VERSION_aeson(2,2,0) liftParseJSON o p pl v = fromList . HashMap.toList <$> A.liftParseJSON o p pl v-#else- liftParseJSON p pl v = fromList . HashMap.toList <$> A.liftParseJSON p pl v-#endif instance (Eq k, Hashable k, A.FromJSONKey k, A.FromJSON v) => A.FromJSON (InsOrdHashMap k v) where parseJSON = A.parseJSON1@@ -332,16 +309,6 @@ unorderedTraversal :: Traversal (InsOrdHashMap k a) (InsOrdHashMap k b) a b unorderedTraversal = hashMap . traverse -#if !MIN_VERSION_lens(5,0,0)-instance (Eq k, Hashable k) => Lens.FunctorWithIndex k (InsOrdHashMap k) where- imap = mapWithKey-instance (Eq k, Hashable k) => Lens.FoldableWithIndex k (InsOrdHashMap k) where- ifoldMap = foldMapWithKey- ifoldr = foldrWithKey-instance (Eq k, Hashable k) => Lens.TraversableWithIndex k (InsOrdHashMap k) where- itraverse = traverseWithKey-#endif- ------------------------------------------------------------------------------- -- Optics -------------------------------------------------------------------------------@@ -356,16 +323,6 @@ instance (Eq k, Hashable k) => Optics.At (InsOrdHashMap k a) where at k = Optics.lensVL $ \f m -> Lens.at k f m {-# INLINE at #-}--#if !MIN_VERSION_optics_core(0,4,0)-instance (Eq k, Hashable k) => Optics.FunctorWithIndex k (InsOrdHashMap k) where- imap = mapWithKey-instance (Eq k, Hashable k) => Optics.FoldableWithIndex k (InsOrdHashMap k) where- ifoldMap = foldMapWithKey- ifoldr = foldrWithKey-instance (Eq k, Hashable k) => Optics.TraversableWithIndex k (InsOrdHashMap k) where- itraverse = traverseWithKey-#endif ------------------------------------------------------------------------------- -- Construction
src/Data/HashSet/InsOrd.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-}@@ -80,9 +79,7 @@ import qualified Data.Foldable import qualified GHC.Exts as Exts -#if MIN_VERSION_deepseq(1,4,3) import qualified Control.DeepSeq as NF-#endif import Data.HashMap.InsOrd.Internal @@ -102,11 +99,9 @@ instance NFData k => NFData (InsOrdHashSet k) where rnf (InsOrdHashSet _ hs) = rnf hs -#if MIN_VERSION_deepseq(1,4,3) -- | @since 0.2.5 instance NF.NFData1 InsOrdHashSet where liftRnf rnf1 (InsOrdHashSet _ m) = NF.liftRnf2 rnf1 rnf m-#endif instance Eq k => Eq (InsOrdHashSet k) where InsOrdHashSet _ a == InsOrdHashSet _ b = a == b@@ -197,11 +192,7 @@ instance (Eq k, Hashable k) => Optics.Ixed (InsOrdHashSet k) where ix k = Optics.atraversalVL $ \point f (InsOrdHashSet i m) -> InsOrdHashSet i <$>-#if MIN_VERSION_optics_core(0,3,0) Optics.atraverseOf-#else- Optics.toAtraversalVL-#endif (Optics.ix k) point (\j -> j <$ f ()) m {-# INLINE ix #-} @@ -312,11 +303,7 @@ toHashSet :: InsOrdHashSet k -> HashSet k toHashSet (InsOrdHashSet _ m) =-#if MIN_VERSION_unordered_containers(0,2,10) HashMap.keysSet m-#else- HashSet.fromMap (fmap (const ()) m)-#endif ------------------------------------------------------------------------------- -- Internal