diff options
author | lassulus <lassulus@lassul.us> | 2021-08-17 08:58:54 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-08-19 14:15:21 +0200 |
commit | af115b860978ca7eb9bbcb776e07bd67a7e8af39 (patch) | |
tree | 40027bf7be7c1c0f3021b37f1b91bdf58ecf563b /pkgs/development/haskell-modules/patches | |
parent | 5ebd941b75a8a680caaa5e014b7aced43643f47f (diff) |
haskellPackages.graphql-engine: 2.0.5 -> 2.0.7
Diffstat (limited to 'pkgs/development/haskell-modules/patches')
-rw-r--r-- | pkgs/development/haskell-modules/patches/graphql-engine-mapkeys.patch | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/pkgs/development/haskell-modules/patches/graphql-engine-mapkeys.patch b/pkgs/development/haskell-modules/patches/graphql-engine-mapkeys.patch index 5fcf408b2b0e2..9035185dc2d58 100644 --- a/pkgs/development/haskell-modules/patches/graphql-engine-mapkeys.patch +++ b/pkgs/development/haskell-modules/patches/graphql-engine-mapkeys.patch @@ -1,13 +1,33 @@ diff --git a/server/src-lib/Data/HashMap/Strict/Extended.hs b/server/src-lib/Data/HashMap/Strict/Extended.hs -index eaff0dfba..5047a0e9d 100644 +index eaff0dfba..9902cadd0 100644 --- a/src-lib/Data/HashMap/Strict/Extended.hs +++ b/src-lib/Data/HashMap/Strict/Extended.hs -@@ -17,7 +17,7 @@ import qualified Data.Align as A - import qualified Data.Foldable as F +@@ -7,7 +7,6 @@ module Data.HashMap.Strict.Extended + , groupOnNE + , differenceOn + , lpadZip +- , mapKeys + , unionsWith + ) where - import Data.Function --import Data.HashMap.Strict as M -+import Data.HashMap.Strict as M hiding (mapKeys) - import Data.Hashable - import Data.List.NonEmpty (NonEmpty (..)) - import Data.These +@@ -54,20 +53,6 @@ lpadZip left = catMaybes . flip A.alignWith left \case + That b -> Just (Nothing, b) + These a b -> Just (Just a, b) + +--- | @'mapKeys' f s@ is the map obtained by applying @f@ to each key of @s@. +--- +--- The size of the result may be smaller if @f@ maps two or more distinct +--- keys to the same new key. In this case the value at the greatest of the +--- original keys is retained. +--- +--- > mapKeys (+ 1) (fromList [(5,"a"), (3,"b")]) == fromList [(4, "b"), (6, "a")] +--- > mapKeys (\ _ -> 1) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")]) == singleton 1 "c" +--- > mapKeys (\ _ -> 3) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")]) == singleton 3 "c" +--- +--- copied from https://hackage.haskell.org/package/containers-0.6.4.1/docs/src/Data.Map.Internal.html#mapKeys +-mapKeys :: (Ord k2, Hashable k2) => (k1 -> k2) -> HashMap k1 a -> HashMap k2 a +-mapKeys f = fromList . foldrWithKey (\k x xs -> (f k, x) : xs) [] +- + -- | The union of a list of maps, with a combining operation: + -- (@'unionsWith' f == 'Prelude.foldl' ('unionWith' f) 'empty'@). + -- |