Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GHC 9 #71

Merged
merged 4 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ workflows:
- run_build_and_test:
name: test_latest
latest: true
- run_build_and_test:
name: test_ghc_9.0
stack_yaml: stack-ghc-9.0.yaml
- run_build_and_test:
name: test_ghc_8.10
stack_yaml: stack-ghc-8.10.yaml
Expand Down
10 changes: 5 additions & 5 deletions aeson-schemas.cabal
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cabal-version: >= 1.10

-- 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: 80faccce54f3481d8cd37abc188cd5c521e19f5f78f181e08be5c8acd2c0a432
-- hash: 9c7dcbeb57bbc2a26ee2ae8f24e1858196b44eb7c24d47ebc635162318a75886

name: aeson-schemas
version: 1.3.3
Expand Down Expand Up @@ -81,7 +81,7 @@ library
, first-class-families >=0.3.0.0 && <0.9
, hashable >=1.2.7.0 && <1.4
, megaparsec >=6.0.0 && <10
, template-haskell >=2.12.0.0 && <2.17
, template-haskell >=2.12.0.0 && <2.18
, text >=1.2.2.2 && <1.3
, unordered-containers >=0.2.8.0 && <0.3
if impl(ghc >= 8.0)
Expand Down Expand Up @@ -134,7 +134,7 @@ test-suite aeson-schemas-test
, tasty-golden
, tasty-hunit
, tasty-quickcheck
, template-haskell >=2.12.0.0 && <2.17
, template-haskell >=2.12.0.0 && <2.18
, text >=1.2.2.2 && <1.3
, th-orphans
, th-test-utils
Expand Down Expand Up @@ -170,7 +170,7 @@ benchmark aeson-schemas-bench
, first-class-families >=0.3.0.0 && <0.9
, hashable >=1.2.7.0 && <1.4
, megaparsec >=6.0.0 && <10
, template-haskell >=2.12.0.0 && <2.17
, template-haskell >=2.12.0.0 && <2.18
, text >=1.2.2.2 && <1.3
, th-test-utils
, unordered-containers >=0.2.8.0 && <0.3
Expand Down
9 changes: 9 additions & 0 deletions bench/Utils/DeepSeq.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ instance NFData Type
instance NFData TypeFamilyHead
instance NFData TyLit
instance NFData TySynEqn

#if MIN_VERSION_template_haskell(2,17,0)
instance NFData Specificity
#endif

#if MIN_VERSION_template_haskell(2,17,0)
instance NFData flag => NFData (TyVarBndr flag)
#else
instance NFData TyVarBndr
#endif

#if MIN_VERSION_template_haskell(2,16,0)
instance NFData Bytes
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies:
- first-class-families >= 0.3.0.0 && < 0.9
- hashable >= 1.2.7.0 && < 1.4
- megaparsec >= 6.0.0 && < 10
- template-haskell >= 2.12.0.0 && < 2.17
- template-haskell >= 2.12.0.0 && < 2.18
- text >= 1.2.2.2 && < 1.3
- unordered-containers >= 0.2.8.0 && < 0.3

Expand Down
3 changes: 3 additions & 0 deletions src/Data/Aeson/Schema/TH/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ stripKinds ty =
UnboxedTupleT _ -> ty
UnboxedSumT _ -> ty
ArrowT -> ty
#if MIN_VERSION_template_haskell(2,17,0)
MulArrowT -> ty
#endif
EqualityT -> ty
ListT -> ty
PromotedTupleT _ -> ty
Expand Down
5 changes: 5 additions & 0 deletions stack-ghc-9.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resolver: nightly-2021-06-10
compiler: ghc-9.0.1

ghc-options:
'$locals': -Werror
9 changes: 9 additions & 0 deletions test/TestUtils/DeepSeq.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ instance NFData Type
instance NFData TypeFamilyHead
instance NFData TyLit
instance NFData TySynEqn

#if MIN_VERSION_template_haskell(2,17,0)
instance NFData Specificity
#endif

#if MIN_VERSION_template_haskell(2,17,0)
instance NFData flag => NFData (TyVarBndr flag)
#else
instance NFData TyVarBndr
#endif

#if MIN_VERSION_template_haskell(2,16,0)
instance NFData Bytes
Expand Down
4 changes: 3 additions & 1 deletion test/Tests/SchemaQQ/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module Tests.SchemaQQ.TH where
import Control.DeepSeq (deepseq)
import Data.Aeson (FromJSON, ToJSON)
import Foreign.C (CBool (..))
import Language.Haskell.TH (appTypeE)
import Language.Haskell.TH.Quote (QuasiQuoter (..))
import Language.Haskell.TH.TestUtils (
MockedMode (..),
Expand Down Expand Up @@ -80,7 +81,8 @@ qState =
schemaRep :: QuasiQuoter
schemaRep = mkExpQQ $ \s ->
let schemaType = quoteType schema s
in [|runTestQ qState (quoteType schema s) `deepseq` showSchema @ $schemaType|]
showSchemaQ = appTypeE [|showSchema|] schemaType
in [|runTestQ qState (quoteType schema s) `deepseq` $showSchemaQ|]

schemaErr :: QuasiQuoter
schemaErr = mkExpQQ $ \s -> [|runTestQErr qState (quoteType schema s)|]