Skip to content

Commit aa5e66b

Browse files
committed
Re-apply PR # 46
1 parent 28dab32 commit aa5e66b

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.github/workflows/haskell.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
ghc: ["8.10.7", "9.2.7", "9.6.1"]
28+
ghc: ["8.10.7", "9.2.7", "9.6.3", "9.8.1"]
2929
os: [ubuntu-latest, macos-latest, windows-latest]
3030
cabal: ["3.10.1.0"]
3131

hedgehog-extras.cabal

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ source-repository head
1919
common aeson { build-depends: aeson >= 2.1.0.0 }
2020
common aeson-pretty { build-depends: aeson-pretty >= 0.8.5 }
2121
common async { build-depends: async }
22-
common base { build-depends: base >= 4.12 && < 4.19 }
22+
common base { build-depends: base >= 4.12 && < 4.20 }
2323
common bytestring { build-depends: bytestring }
2424
common deepseq { build-depends: deepseq }
2525
common Diff { build-depends: Diff }
@@ -41,7 +41,6 @@ common text { build-depends: text
4141
common time { build-depends: time >= 1.9.1 }
4242
common transformers { build-depends: transformers }
4343
common unliftio { build-depends: unliftio }
44-
common unordered-containers { build-depends: unordered-containers }
4544
common yaml { build-depends: yaml }
4645
common zlib { build-depends: zlib }
4746

@@ -86,7 +85,6 @@ library
8685
time,
8786
transformers,
8887
unliftio,
89-
unordered-containers,
9088
Win32,
9189
yaml,
9290
zlib,

src/Hedgehog/Extras/Stock/Aeson.hs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
{-# LANGUAGE LambdaCase #-}
2+
13
module Hedgehog.Extras.Stock.Aeson
24
( rewriteObject
35
, rewriteArrayElements
46
) where
57

68
import Data.Aeson
7-
import Data.Functor
8-
import Data.HashMap.Lazy
9-
import Data.Text
9+
import Data.Aeson.KeyMap (KeyMap)
1010
import Prelude ((.), ($))
1111

1212
import qualified HaskellWorks.Data.Aeson.Compat.Map as KM
@@ -21,6 +21,7 @@ rewriteObject _ v = v
2121
-- | Rewrite each element of a JSON array using the function 'f'.
2222
--
2323
-- All other JSON values are preserved.
24-
rewriteArrayElements :: (Value -> Value) -> Value -> Value
25-
rewriteArrayElements f (Array hm) = Array (fmap f hm)
26-
rewriteArrayElements _ v = v
24+
rewriteObject :: (KeyMap Value -> KeyMap Value) -> Value -> Value
25+
rewriteArrayElements f = \case
26+
Array hm -> Array (fmap f hm)
27+
v -> v

0 commit comments

Comments
 (0)