diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 723389b06..4b4ccbecd 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.19.20250330 +# version: 0.19.20260331 # -# REGENDATA ("0.19.20250330",["github","cabal.project"]) +# REGENDATA ("0.19.20260331",["github","cabal.project"]) # name: Haskell-CI on: @@ -20,6 +20,11 @@ on: pull_request: branches: - master + merge_group: + branches: + - master + workflow_dispatch: + {} jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} @@ -32,9 +37,14 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.12.1 + - compiler: ghc-9.14.1 + compilerKind: ghc + compilerVersion: 9.14.1 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.12.4 compilerKind: ghc - compilerVersion: 9.12.1 + compilerVersion: 9.12.4 setup-method: ghcup allow-failure: false - compiler: ghc-9.10.1 @@ -95,8 +105,8 @@ jobs: chmod a+x "$HOME/.ghcup/bin/ghcup" - name: Install cabal-install run: | - "$HOME/.ghcup/bin/ghcup" install cabal 3.14.1.1-p1 || (cat "$HOME"/.ghcup/logs/*.* && false) - echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.1-p1 -vnormal+nowrap" >> "$GITHUB_ENV" + "$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV" - name: Install GHC (GHCup) if: matrix.setup-method == 'ghcup' run: | @@ -174,14 +184,14 @@ jobs: - name: install cabal-docspec run: | mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20240703/cabal-docspec-0.0.0.20240703-x86_64-linux.xz > cabal-docspec.xz - echo '48bf3b7fd2f7f0caa6162afee57a755be8523e7f467b694900eb420f5f9a7b76 cabal-docspec.xz' | sha256sum -c - + curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20250606/cabal-docspec-0.0.0.20250606-x86_64-linux.xz > cabal-docspec.xz + echo 'cc20bb5c19501b42bde77556bc419c7c0a5c8d1eb65663024d8a4e4c868bef25 cabal-docspec.xz' | sha256sum -c - xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec rm -f cabal-docspec.xz chmod a+x $HOME/.cabal/bin/cabal-docspec cabal-docspec --version - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: path: source - name: initial cabal.project for sdist @@ -226,17 +236,41 @@ jobs: echo "packages: ${PKGDIR_aeson_examples}" >> cabal.project echo "packages: ${PKGDIR_aeson_benchmarks}" >> cabal.project echo "package aeson" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project echo "package attoparsec-iso8601" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project echo "package attoparsec-aeson" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project echo "package text-iso8601" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project echo "package aeson-examples" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project echo "package aeson-benchmarks" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package aeson" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package attoparsec-iso8601" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package attoparsec-aeson" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package text-iso8601" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package aeson-examples" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package aeson-benchmarks" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package aeson" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package attoparsec-iso8601" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package attoparsec-aeson" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package text-iso8601" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package aeson-examples" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package aeson-benchmarks" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi cat >> cabal.project <=4.12.0.0 && <5 , bytestring >=0.10.8.2 && <0.13 - , containers >=0.6.0.1 && <0.8 + , containers >=0.6.0.1 && <0.9 , deepseq >=1.4.4.0 && <1.6 , exceptions >=0.10.4 && <0.11 - , ghc-prim >=0.5.0.0 && <0.14 - , template-haskell >=2.14.0.0 && <2.24 + , template-haskell >=2.14.0.0 && <2.25 , text >=1.2.3.0 && <1.3 || >=2.0 && <2.2 - , time >=1.8.0.2 && <1.15 + , time >=1.8.0.2 && <1.16 -- Compat build-depends: - , generically >=0.1 && <0.2 , time-compat >=1.9.6 && <1.10 + if !impl(ghc >=9.4) + build-depends: generically >=0.1 && <0.2 + if !impl(ghc >=9.0) build-depends: integer-gmp @@ -203,20 +205,17 @@ test-suite aeson-tests , bytestring , containers , data-fix - , deepseq , Diff >=0.4 && <0.6 || ^>=1.0.2 , directory , dlist , filepath , generic-deriving >=1.10 && <1.15 , generically - , ghc-prim >=0.2 , hashable , indexed-traversable , integer-logarithms >=1 && <1.1 , network-uri , OneTuple - , primitive , QuickCheck , quickcheck-instances >=0.3.29 && <0.5 , scientific @@ -226,7 +225,6 @@ test-suite aeson-tests , tasty-golden , tasty-hunit , tasty-quickcheck - , template-haskell , text , text-short , these diff --git a/attoparsec-aeson/attoparsec-aeson.cabal b/attoparsec-aeson/attoparsec-aeson.cabal index c1fee98c4..4218fc8e1 100644 --- a/attoparsec-aeson/attoparsec-aeson.cabal +++ b/attoparsec-aeson/attoparsec-aeson.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: attoparsec-aeson -version: 2.2.2.0 +version: 2.2.2.1 synopsis: Parsing of aeson's Value with attoparsec description: Parsing of aeson's Value with attoparsec, originally from aeson. @@ -28,7 +28,8 @@ tested-with: || ==9.6.6 || ==9.8.4 || ==9.10.1 - || ==9.12.1 + || ==9.12.4 + || ==9.14.1 library hs-source-dirs: src @@ -49,7 +50,6 @@ library , bytestring >=0.10.8.2 && <0.13 , character-ps ^>=0.1 , integer-conversion >=0.1 && <0.2 - , primitive >=0.8.0.0 && <0.10 , scientific >=0.3.7.0 && <0.4 , text >=1.2.3.0 && <1.3 || >=2.0 && <2.2 , vector >=0.12.0.1 && <0.14 diff --git a/attoparsec-iso8601/attoparsec-iso8601.cabal b/attoparsec-iso8601/attoparsec-iso8601.cabal index bf8285e6d..35325e2fd 100644 --- a/attoparsec-iso8601/attoparsec-iso8601.cabal +++ b/attoparsec-iso8601/attoparsec-iso8601.cabal @@ -27,7 +27,8 @@ tested-with: || ==9.6.6 || ==9.8.4 || ==9.10.1 - || ==9.12.1 + || ==9.12.4 + || ==9.14.1 extra-source-files: changelog.md @@ -46,7 +47,7 @@ library , base >=4.12.0.0 && <5 , integer-conversion >=0.1 && <0.2 , text >=1.2.3.0 && <1.3.0.0 || >=2.0 && <2.2 - , time >=1.8.0.2 && <1.15 + , time >=1.8.0.2 && <1.16 , time-compat >=1.9.4 && <1.10 source-repository head diff --git a/benchmarks/aeson-benchmarks.cabal b/benchmarks/aeson-benchmarks.cabal index 5323dc698..c90ced108 100644 --- a/benchmarks/aeson-benchmarks.cabal +++ b/benchmarks/aeson-benchmarks.cabal @@ -12,7 +12,8 @@ tested-with: || ==9.6.6 || ==9.8.4 || ==9.10.1 - || ==9.12.1 + || ==9.12.4 + || ==9.14.1 flag tasty-bench description: Use tasty-bench, otherwise criterion @@ -49,7 +50,6 @@ executable aeson-bench build-depends: aeson - , attoparsec , attoparsec-aeson , base , base-compat-batteries @@ -61,9 +61,7 @@ executable aeson-bench , filepath , hashable , json - , scientific , tagged - , template-haskell , text , time , unordered-containers diff --git a/examples/aeson-examples.cabal b/examples/aeson-examples.cabal index 02a96dad1..992c1fb0d 100644 --- a/examples/aeson-examples.cabal +++ b/examples/aeson-examples.cabal @@ -18,7 +18,8 @@ tested-with: || ==9.6.6 || ==9.8.4 || ==9.10.1 - || ==9.12.1 + || ==9.12.4 + || ==9.14.1 library twitter-generic default-language: Haskell2010 @@ -32,7 +33,6 @@ library twitter-generic build-depends: aeson , base <5 - , base-compat , deepseq , text @@ -48,7 +48,6 @@ library twitter-th build-depends: aeson , base <5 - , base-compat , deepseq , text @@ -63,7 +62,6 @@ library twitter-manual build-depends: aeson , base <5 - , base-compat-batteries , deepseq , text @@ -75,7 +73,6 @@ library github build-depends: aeson , base <5 - , base-compat-batteries , deepseq , text , time @@ -89,7 +86,6 @@ executable aeson-example-generic build-depends: aeson , base <5 - , base-compat , bytestring executable aeson-example-simplest @@ -100,7 +96,6 @@ executable aeson-example-simplest build-depends: aeson , base <5 - , base-compat-batteries , bytestring executable aeson-example-th @@ -111,5 +106,4 @@ executable aeson-example-th build-depends: aeson , base <5 - , base-compat , bytestring diff --git a/examples/src/Generic.hs b/examples/src/Generic.hs index 60b21bb45..d7b4f345f 100644 --- a/examples/src/Generic.hs +++ b/examples/src/Generic.hs @@ -6,13 +6,10 @@ -- automatically derive the Generic class for us. {-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Main (main) where -import Prelude.Compat - import Data.Aeson (FromJSON, ToJSON, decode, encode) import qualified Data.ByteString.Lazy.Char8 as BL import GHC.Generics (Generic) diff --git a/examples/src/GitHub.hs b/examples/src/GitHub.hs index 58012838a..6a52197ec 100644 --- a/examples/src/GitHub.hs +++ b/examples/src/GitHub.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} -- From github package: https://hackage.haskell.org/package/github @@ -35,8 +34,6 @@ -- module GitHub where -import Prelude.Compat - import Control.DeepSeq (NFData (..)) import Data.Text (Text) import Data.Time (UTCTime) diff --git a/examples/src/Simplest.hs b/examples/src/Simplest.hs index 1b9ee89a1..759f7d05c 100644 --- a/examples/src/Simplest.hs +++ b/examples/src/Simplest.hs @@ -1,10 +1,8 @@ -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Main (main) where -import Prelude.Compat import Data.Aeson import Control.Applicative (empty) diff --git a/examples/src/TemplateHaskell.hs b/examples/src/TemplateHaskell.hs index 940fc7ebd..bbce4ec26 100644 --- a/examples/src/TemplateHaskell.hs +++ b/examples/src/TemplateHaskell.hs @@ -1,14 +1,11 @@ -- We can use Template Haskell (TH) to generate instances of the -- FromJSON and ToJSON classes automatically. This is the fastest way -- to add JSON support for a type. -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Main (main) where -import Prelude.Compat - import Data.Aeson (decode, encode) import Data.Aeson.TH (deriveJSON, defaultOptions) import qualified Data.ByteString.Lazy.Char8 as BL diff --git a/examples/src/Twitter.hs b/examples/src/Twitter.hs index 1e1226b1b..f165900e8 100644 --- a/examples/src/Twitter.hs +++ b/examples/src/Twitter.hs @@ -10,7 +10,6 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE NoImplicitPrelude #-} module Twitter ( @@ -20,8 +19,6 @@ module Twitter , Result(..) ) where -import Prelude.Compat - import Control.DeepSeq import Data.Data (Typeable, Data) import Data.Int (Int64) diff --git a/examples/src/Twitter/Generic.hs b/examples/src/Twitter/Generic.hs index d122de9bb..91c779ef1 100644 --- a/examples/src/Twitter/Generic.hs +++ b/examples/src/Twitter/Generic.hs @@ -1,7 +1,5 @@ -- Use GHC generics to automatically generate good instances. -{-# LANGUAGE NoImplicitPrelude #-} - {-# OPTIONS_GHC -fno-warn-orphans #-} module Twitter.Generic @@ -12,8 +10,6 @@ module Twitter.Generic , Result(..) ) where -import Prelude.Compat () - import Twitter import Twitter.Options diff --git a/examples/src/Twitter/Manual.hs b/examples/src/Twitter/Manual.hs index 2212cc762..90f235362 100644 --- a/examples/src/Twitter/Manual.hs +++ b/examples/src/Twitter/Manual.hs @@ -1,5 +1,4 @@ -- Manually write instances. -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} @@ -13,8 +12,6 @@ module Twitter.Manual , Result(..) ) where -import Prelude.Compat - import Control.Applicative import Twitter diff --git a/examples/src/Twitter/TH.hs b/examples/src/Twitter/TH.hs index 0707a37a3..a53b28135 100644 --- a/examples/src/Twitter/TH.hs +++ b/examples/src/Twitter/TH.hs @@ -1,6 +1,5 @@ -- Use Template Haskell to generate good instances. -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/src/Data/Aeson/TH.hs b/src/Data/Aeson/TH.hs index 088b1fbae..beaffc58f 100644 --- a/src/Data/Aeson/TH.hs +++ b/src/Data/Aeson/TH.hs @@ -945,7 +945,7 @@ parseRecord jc tvMap argTys opts tName conName fields obj inTaggedObject = (appE [|show|] (varE unknownFields))) [] ] - x:xs = [ lookupField argTy + (x,xs) = nonEmpty [ lookupField argTy `appE` dispatchParseJSON jc conName tvMap argTy `appE` litE (stringL $ show tName) `appE` litE (stringL $ constructorTagModifier opts $ nameBase conName) @@ -955,6 +955,11 @@ parseRecord jc tvMap argTys opts tName conName fields obj inTaggedObject = | (field, argTy) <- zip fields argTys ] +-- A hack, as I'm too lazy to changge code to not assume fields are non empty. +nonEmpty :: [a] -> (a, [a]) +nonEmpty (x:xs) = (x,xs) +nonEmpty [] = error "unexpected empty list" + getValField :: Name -> String -> [MatchQ] -> Q Exp getValField obj valFieldName matches = do val <- newName "val" @@ -1056,12 +1061,12 @@ parseProduct :: JSONClass -- ^ The FromJSON variant being derived. -> [Type] -- ^ The argument types of the constructor. -> Name -- ^ Name of the type to which the constructor belongs. -> Name -- ^ 'Con'structor name. - -> Integer -- ^ 'Con'structor arity. + -> Integer -- ^ 'Con'structor arity. >= 1 -> [Q Match] parseProduct jc tvMap argTys tName conName numArgs = [ do arr <- newName "arr" -- List of: "parseJSON (arr `V.unsafeIndex` )" - let x:xs = [ dispatchParseJSON jc conName tvMap argTy + let (x,xs) = nonEmpty [ dispatchParseJSON jc conName tvMap argTy `appE` infixApp (varE arr) [|V.unsafeIndex|] diff --git a/text-iso8601/text-iso8601.cabal b/text-iso8601/text-iso8601.cabal index 6cf55c641..c2c526522 100644 --- a/text-iso8601/text-iso8601.cabal +++ b/text-iso8601/text-iso8601.cabal @@ -1,7 +1,6 @@ cabal-version: 1.12 name: text-iso8601 -version: 0.1.1 -x-revision: 3 +version: 0.1.1.1 synopsis: Converting time to and from ISO 8601 text. description: Converting time to and from IS0 8601 text. @@ -28,7 +27,8 @@ tested-with: || ==9.6.6 || ==9.8.4 || ==9.10.1 - || ==9.12.1 + || ==9.12.4 + || ==9.14.1 extra-source-files: changelog.md @@ -49,7 +49,7 @@ library base >=4.12.0.0 && <5 , integer-conversion >=0.1 && <0.2 , text >=1.2.3.0 && <1.3.0.0 || >=2.0 && <2.2 - , time >=1.8.0.2 && <1.15 + , time >=1.8.0.2 && <1.16 , time-compat >=1.9.4 && <1.10 test-suite text-iso8601-tests @@ -82,7 +82,6 @@ benchmark text-iso8601-bench base , text , text-iso8601 - , time-compat -- bench dependencies build-depends: