ten-unordered-containers 0.1.0.2 → 0.1.0.3
raw patch · 4 files changed
+47/−33 lines, 4 filesdep ~basedep ~portrayPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, portray
API changes (from Hackage documentation)
Files
- CHANGELOG.md +9/−5
- src/Data/Ten/HashMap.hs +5/−3
- ten-unordered-containers.cabal +13/−19
- test/Main.hs +20/−6
CHANGELOG.md view
@@ -1,11 +1,15 @@-# 0.1.0.0+# 0.1.0.3 (2021-11-02) -Initial version.+* Support GHC-9.2.1. -# 0.1.0.1+# 0.1.0.2 (2021-10-11) +* Support portray-0.2.++# 0.1.0.1 (2021-09-14)+ * Extend support back to GHC 8.6. -# 0.1.0.2+# 0.1.0.0 (2021-09-02) -* Support portray-0.2.+Initial version.
src/Data/Ten/HashMap.hs view
@@ -15,6 +15,7 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingVia #-}+{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-}@@ -129,9 +130,10 @@ where ((Any anyDiff, All allDiff), diffs) = traverse diffM $- HM.unionWith (\ (InLeft x) (InRight y) -> InBoth x y)- (InLeft <$> l)- (InRight <$> r)+ HM.unionWith combine (InLeft <$> l) (InRight <$> r)++ combine (InLeft x) (InRight y) = InBoth x y+ combine _ _ = error "Impossible" -- | An empty 'HashMap10'. empty :: HashMap10 k m
ten-unordered-containers.cabal view
@@ -1,14 +1,12 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.0.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack------ hash: d03c56a37f35170e077e000599e38ae3b5326929a14acca36d873bd5afa407db name: ten-unordered-containers-version: 0.1.0.2-synopsis: A package providing one unordered container.+version: 0.1.0.3+synopsis: Higher-kinded hash containers description: This provides unordered (hash-based) containers of kind @(k -> Type) -> Type@ based on <https://hackage.haskell.org/package/unordered-containers unordered-containers>.@@ -33,39 +31,35 @@ library exposed-modules: Data.Ten.HashMap- other-modules:- Paths_ten_unordered_containers hs-source-dirs: src build-depends:- base >=4.12 && <4.16+ base >=4.12 && <4.17 , hashable >=1.0 && <1.4 , portray >=0.1.1 && <0.3- , portray-diff >=0.1 && <0.2- , some >=1.0 && <1.1- , ten >=0.1 && <0.2+ , portray-diff ==0.1.*+ , some ==1.0.*+ , ten ==0.1.* , unordered-containers >=0.1 && <0.3- , wrapped >=0.1 && <0.2+ , wrapped ==0.1.* default-language: Haskell2010 test-suite HashMap-test type: exitcode-stdio-1.0 main-is: Main.hs- other-modules:- Paths_ten_unordered_containers hs-source-dirs: test build-depends: HUnit- , base >=4.12 && <4.16+ , base >=4.12 && <4.17 , hashable >=1.0 && <1.4 , lens , portray >=0.1.1 && <0.3- , portray-diff >=0.1 && <0.2+ , portray-diff ==0.1.* , portray-diff-hunit , portray-pretty- , some >=1.0 && <1.1- , ten >=0.1 && <0.2+ , some ==1.0.*+ , ten ==0.1.* , ten-lens , ten-unordered-containers , test-framework@@ -73,5 +67,5 @@ , text , transformers , unordered-containers >=0.1 && <0.3- , wrapped >=0.1 && <0.2+ , wrapped ==0.1.* default-language: Haskell2010
test/Main.hs view
@@ -13,6 +13,7 @@ -- limitations under the License. {-# LANGUAGE AllowAmbiguousTypes #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingVia #-}@@ -101,17 +102,25 @@ , testCase "portray non-empty" $ showPortrayal (HM.fromList [dynProxy @Int, dynProxy @(Int -> Int)]) @?=- "fromList\n\+ "fromList\n\\ \ [ typeRep @Int :** Proxy, typeRep @(Int -> Int) :** Proxy ]" , testCase "portray Identity" $ showPortrayal exampleMap @?=- "fromList\n\- \ [ Field10 _erInt :** Identity 2\- \, Field10 _erBool :** Identity True\n\- \ , Field10 (_irText . _erNest) :** Identity \"aoeu\"\n\+-- Text hashing changed, which changed the order seen by toList.+#if MIN_VERSION_hashable(1, 3, 4)+ "fromList\n\\+ \ [ Field10 (_irText . _erNest) :** Identity \"aoeu\"\n\\+ \ , Field10 _erBool :** Identity True\\+ \, Field10 _erInt :** Identity 2\n\\ \ ]"-+#else+ "fromList\n\\+ \ [ Field10 _erInt :** Identity 2\\+ \, Field10 _erBool :** Identity True\n\\+ \ , Field10 (_irText . _erNest) :** Identity \"aoeu\"\n\\+ \ ]"+#endif , testCase "length10" $ getSum @Int (foldMap10 (const (Sum 1)) (HM.fromList @TypeRep @Proxy [])) @?= 0@@ -126,7 +135,12 @@ , erBool != [True, True] , erNest.irText != ["aoeu", "aoeu"] ]+-- Text hashing changed, which changed the traversal order.+#if MIN_VERSION_hashable(1, 3, 4)+ , ["\"aoeu\"", "True", "2"]+#else , ["2", "True", "\"aoeu\""]+#endif ) , testCase "toHashMap" $