Skip to content

Commit a331df5

Browse files
committed
Make it build with ghc-9.8
Drop hw-aeson dependency on the way.
1 parent 6c9e229 commit a331df5

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

hedgehog-extras.cabal

+1-5
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 }
@@ -28,7 +28,6 @@ common exceptions { build-depends: exceptions
2828
common filepath { build-depends: filepath }
2929
common hedgehog { build-depends: hedgehog }
3030
common http-conduit { build-depends: http-conduit }
31-
common hw-aeson { build-depends: hw-aeson >= 0.1.8.0 }
3231
common mmorph { build-depends: mmorph }
3332
common mtl { build-depends: mtl }
3433
common network { build-depends: network }
@@ -41,7 +40,6 @@ common text { build-depends: text
4140
common time { build-depends: time >= 1.9.1 }
4241
common transformers { build-depends: transformers }
4342
common unliftio { build-depends: unliftio }
44-
common unordered-containers { build-depends: unordered-containers }
4543
common yaml { build-depends: yaml }
4644
common zlib { build-depends: zlib }
4745

@@ -73,7 +71,6 @@ library
7371
filepath,
7472
hedgehog,
7573
http-conduit,
76-
hw-aeson,
7774
mmorph,
7875
mtl,
7976
network,
@@ -86,7 +83,6 @@ library
8683
time,
8784
transformers,
8885
unliftio,
89-
unordered-containers,
9086
Win32,
9187
yaml,
9288
zlib,

src/Hedgehog/Extras/Stock/Aeson.hs

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@ module Hedgehog.Extras.Stock.Aeson
44
) where
55

66
import Data.Aeson
7+
import Data.Aeson.KeyMap (KeyMap)
78
import Data.Functor
8-
import Data.HashMap.Lazy
9-
import Data.Text
10-
import Prelude ((.), ($))
11-
12-
import qualified HaskellWorks.Data.Aeson.Compat.Map as KM
139

1410
-- | Rewrite a JSON object to another JSON object using the function 'f'.
1511
--
1612
-- All other JSON values are preserved.
17-
rewriteObject :: (HashMap Text Value -> HashMap Text Value) -> Value -> Value
18-
rewriteObject f (Object hm) = Object (KM.fromHashMapText . f . KM.toHashMapText $ hm)
13+
rewriteObject :: (KeyMap Value -> KeyMap Value) -> Value -> Value
14+
rewriteObject f (Object hm) = Object (f hm)
1915
rewriteObject _ v = v
2016

2117
-- | Rewrite each element of a JSON array using the function 'f'.

0 commit comments

Comments
 (0)