Skip to content

Commit

Permalink
Support Aeson 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Vekhir committed Sep 14, 2023
1 parent 8ec6e24 commit 093ce32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clash-lib/clash-lib.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ Library
RecordWildCards
TemplateHaskell

Build-depends: aeson >= 0.6.2.0 && < 2.2,
Build-depends: aeson >= 0.6.2.0 && < 2.3,
attoparsec-aeson >= 2.1 && < 2.3,
aeson-pretty >= 0.8 && < 0.9,
ansi-terminal >= 0.8.0.0 && < 1.1,
array,
Expand Down Expand Up @@ -331,6 +332,7 @@ executable v16-upgrade-primitives
Build-Depends:
base,
aeson,
attoparsec-aeson,
deepseq,
yaml,
bytestring,
Expand Down Expand Up @@ -392,6 +394,7 @@ test-suite unittests
ghc-typelits-knownnat,

aeson,
attoparsec-aeson,
aeson-pretty,
base,
base16-bytestring,
Expand Down
5 changes: 5 additions & 0 deletions clash-lib/src/Data/Aeson/Extra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ import Data.List (intercalate)
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NE
import Data.Tuple.Extra (second, first)
#if MIN_VERSION_aeson(2,2,0)
import Data.Aeson (FromJSON, Result (..), fromJSON)
import Data.Aeson.Parser (json)
#else
import Data.Aeson (FromJSON, Result (..), fromJSON, json)
#endif
import Data.Attoparsec.Lazy (Result (..), parse)
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as BS
Expand Down

0 comments on commit 093ce32

Please sign in to comment.