From 1895e273092999d397aa9ed44938e976db9f0295 Mon Sep 17 00:00:00 2001 From: Giorgio Marinelli Date: Fri, 24 Apr 2026 13:41:56 +0200 Subject: [PATCH 1/3] Update CI --- .github/workflows/haskell-ci.yml | 8 ++++---- src/Deriving/TaggedJson.hs | 13 ++++++++++++- tagged-json.cabal | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index e957050..cb8fc84 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.20260209 +# version: 0.19.20260331 # -# REGENDATA ("0.19.20260209",["github","--config=cabal.haskell-ci","tagged-json.cabal"]) +# REGENDATA ("0.19.20260331",["github","--config=cabal.haskell-ci","tagged-json.cabal"]) # name: Haskell-CI on: @@ -37,9 +37,9 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.12.2 + - compiler: ghc-9.12.4 compilerKind: ghc - compilerVersion: 9.12.2 + compilerVersion: 9.12.4 setup-method: ghcup allow-failure: false - compiler: ghc-9.10.3 diff --git a/src/Deriving/TaggedJson.hs b/src/Deriving/TaggedJson.hs index e7e8475..d1f237d 100644 --- a/src/Deriving/TaggedJson.hs +++ b/src/Deriving/TaggedJson.hs @@ -1,4 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE CPP #-} module Deriving.TaggedJson ( GTaggedJSON (..), @@ -23,7 +24,6 @@ import Control.Applicative import Data.Aeson.Key qualified as Key import Data.Aeson.KeyMap qualified as KeyMap import Data.Aeson.Types hiding (genericParseJSON, genericToEncoding, genericToJSON) -import Data.HashMap.Strict.InsOrd qualified as HMSI import Data.Kind import Data.List (intercalate) import Data.Maybe @@ -37,6 +37,17 @@ import GHC.Generics import GHC.TypeLits import Optics hiding (to) +-- This is due to a breaking change introduced in insert-ordered-containers-0.3.0 +-- More info are available here: +-- https://github.com/biocad/openapi3/pull/119 +-- https://github.com/erikd/insert-ordered-containers/pull/8 +-- +#if !MIN_VERSION_openapi3(3,2,5) +import Data.HashMap.Strict.InsOrd qualified as HMSI +#else +import Data.HashMap.Strict.InsOrd.Compat qualified as HMSI +#endif + -- * Serialization options data TaggedOptions = TaggedOptions diff --git a/tagged-json.cabal b/tagged-json.cabal index 9996807..30df635 100644 --- a/tagged-json.cabal +++ b/tagged-json.cabal @@ -24,7 +24,7 @@ tested-with: || ==9.6.7 || ==9.8.4 || ==9.10.3 - || ==9.12.2 + || ==9.12.4 source-repository head type: git From b7a8f610fb9a9161e19f320bbf045858d315d89f Mon Sep 17 00:00:00 2001 From: Giorgio Marinelli Date: Fri, 24 Apr 2026 13:55:17 +0200 Subject: [PATCH 2/3] Fix build --- .github/workflows/haskell-ci.yml | 2 -- cabal.haskell-ci | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index cb8fc84..909dd81 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -183,8 +183,6 @@ jobs: echo "packages: ${PKGDIR_tagged_json}" >> cabal.project echo "package tagged-json" >> cabal.project echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project - if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package tagged-json" >> cabal.project ; fi - if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi echo "package tagged-json" >> cabal.project echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project cat >> cabal.project < Date: Wed, 20 May 2026 22:50:11 +0200 Subject: [PATCH 3/3] Update conditional import --- src/Deriving/TaggedJson.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Deriving/TaggedJson.hs b/src/Deriving/TaggedJson.hs index d1f237d..bc50fd7 100644 --- a/src/Deriving/TaggedJson.hs +++ b/src/Deriving/TaggedJson.hs @@ -42,10 +42,10 @@ import Optics hiding (to) -- https://github.com/biocad/openapi3/pull/119 -- https://github.com/erikd/insert-ordered-containers/pull/8 -- -#if !MIN_VERSION_openapi3(3,2,5) -import Data.HashMap.Strict.InsOrd qualified as HMSI -#else +#if MIN_VERSION_openapi3(3,2,5) && MIN_VERSION_insert_ordered_containers(0,3,0) import Data.HashMap.Strict.InsOrd.Compat qualified as HMSI +#else +import Data.HashMap.Strict.InsOrd qualified as HMSI #endif -- * Serialization options