From 92f13fa95334a7135e63cebe8fc9811cc50bb5b7 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sat, 4 Jan 2025 22:53:14 +0200 Subject: [PATCH] Support GHC-9.12 --- .github/workflows/haskell-ci.yml | 50 +++++++++++-------- cabal.project | 3 -- monad-chronicle/CHANGELOG.md | 6 +++ monad-chronicle/monad-chronicle.cabal | 13 +++-- .../src/Control/Monad/Chronicle/Class.hs | 10 ---- .../src/Control/Monad/Trans/Chronicle.hs | 12 +---- semialign/semialign.cabal | 7 +-- these-lens/these-lens.cabal | 8 +-- these-optics/these-optics.cabal | 8 +-- these-tests/these-tests.cabal | 9 ++-- these/these.cabal | 9 ++-- 11 files changed, 66 insertions(+), 69 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 3260dc6..619d189 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.20240514 +# version: 0.19.20250104 # -# REGENDATA ("0.19.20240514",["github","cabal.project"]) +# REGENDATA ("0.19.20250104",["github","cabal.project"]) # name: Haskell-CI on: @@ -32,19 +32,24 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.12.1 + compilerKind: ghc + compilerVersion: 9.12.1 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.10.1 compilerKind: ghc compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.8.2 + - compiler: ghc-9.8.4 compilerKind: ghc - compilerVersion: 9.8.2 + compilerVersion: 9.8.4 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.5 + - compiler: ghc-9.6.6 compilerKind: ghc - compilerVersion: 9.6.5 + compilerVersion: 9.6.6 setup-method: ghcup allow-failure: false - compiler: ghc-9.4.8 @@ -79,15 +84,29 @@ jobs: allow-failure: false fail-fast: false steps: - - name: apt + - name: apt-get install run: | apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 + - name: Install GHCup + run: | mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" + - name: Install cabal-install + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.14.1.1 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.1 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' + run: | "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -98,21 +117,12 @@ jobs: echo "LANG=C.UTF-8" >> "$GITHUB_ENV" echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" - HCDIR=/opt/$HCKIND/$HCVER - HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") - HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') - HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" - echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -219,8 +229,6 @@ jobs: echo "package these-tests" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local cat cabal.project @@ -284,8 +292,8 @@ jobs: cabal-plan topo | sort $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='monad-chronicle -semigroupoids' --constraint='semialign -semigroupoids' all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/cabal.project b/cabal.project index 625325f..5e14f00 100644 --- a/cabal.project +++ b/cabal.project @@ -6,6 +6,3 @@ packages: monad-chronicle packages: these-tests tests: true - -allow-newer: quickcheck-instances:base -allow-newer: quickcheck-instances:containers diff --git a/monad-chronicle/CHANGELOG.md b/monad-chronicle/CHANGELOG.md index 5472809..81866a2 100644 --- a/monad-chronicle/CHANGELOG.md +++ b/monad-chronicle/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.1 + +- Remove `disclose`. Use `dictate c >> return def` if you need it. + No more dependency of `data-default` or `data-default-class`. + This change is a consequence of change in `data-default-0.8.0.0` + # 1.0.2 - Support GHC-8.6.5...GHC-9.10.1 diff --git a/monad-chronicle/monad-chronicle.cabal b/monad-chronicle/monad-chronicle.cabal index 4ceec73..8e119ed 100644 --- a/monad-chronicle/monad-chronicle.cabal +++ b/monad-chronicle/monad-chronicle.cabal @@ -1,6 +1,6 @@ cabal-version: >=1.10 name: monad-chronicle -version: 1.0.2 +version: 1.1 synopsis: These as a transformer, ChronicleT homepage: https://github.com/haskellari/these license: BSD3 @@ -22,9 +22,10 @@ tested-with: || ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.5 - || ==9.8.2 + || ==9.6.6 + || ==9.8.4 || ==9.10.1 + || ==9.12.1 source-repository head type: git @@ -46,16 +47,14 @@ library -- ghc boot libs build-depends: - base >=4.12.0.0 && <4.21 + base >=4.12.0.0 && <4.22 , mtl >=2.2.2 && <2.4 , transformers >=0.5.6.2 && <0.7 build-depends: these >=1.2.1 && <1.3 -- other dependencies - build-depends: - data-default-class >=0.1.2.0 && <0.2 - , transformers-compat >=0.6.5 && <0.8 + build-depends: transformers-compat >=0.6.5 && <0.8 if flag(semigroupoids) build-depends: semigroupoids >=6.0.1 && <6.1 diff --git a/monad-chronicle/src/Control/Monad/Chronicle/Class.hs b/monad-chronicle/src/Control/Monad/Chronicle/Class.hs index 97f5622..68e6016 100644 --- a/monad-chronicle/src/Control/Monad/Chronicle/Class.hs +++ b/monad-chronicle/src/Control/Monad/Chronicle/Class.hs @@ -41,7 +41,6 @@ import Control.Monad.Trans.Error as Error import Control.Monad (liftM) import Control.Monad.Trans.Class (lift) -import Data.Default.Class import Data.Semigroup import Prelude @@ -51,15 +50,6 @@ class (Monad m) => MonadChronicle c m | m -> c where -- Equivalent to 'tell' for the 'Writer' monad. dictate :: c -> m () - -- | @'disclose' c@ is an action that records the output @c@ and returns a - -- @'Default'@ value. - -- - -- This is a convenience function for reporting non-fatal errors in one - -- branch a @case@, or similar scenarios when there is no meaningful - -- result but a placeholder of sorts is needed in order to continue. - disclose :: (Default a) => c -> m a - disclose c = dictate c >> return def - -- | @'confess' c@ is an action that ends with a final record @c@. -- -- Equivalent to 'throwError' for the 'Error' monad. diff --git a/monad-chronicle/src/Control/Monad/Trans/Chronicle.hs b/monad-chronicle/src/Control/Monad/Trans/Chronicle.hs index 66df633..2fde4e6 100644 --- a/monad-chronicle/src/Control/Monad/Trans/Chronicle.hs +++ b/monad-chronicle/src/Control/Monad/Trans/Chronicle.hs @@ -19,7 +19,7 @@ module Control.Monad.Trans.Chronicle ( -- * The ChronicleT monad transformer ChronicleT(..), -- * Chronicle operations - dictate, disclose, confess, + dictate, confess, memento, absolve, condemn, retcon, ) where @@ -28,7 +28,6 @@ import Control.Applicative import Control.Monad import Control.Monad.Fix import Control.Monad.Trans -import Data.Default.Class import Data.Functor.Identity import Data.Semigroup @@ -155,15 +154,6 @@ instance (Semigroup c, MonadFix m) => MonadFix (ChronicleT c m) where dictate :: (Semigroup c, Monad m) => c -> ChronicleT c m () dictate c = ChronicleT $ return (These c ()) --- | @'disclose' c@ is an action that records the output @c@ and returns a --- @'Default'@ value. --- --- This is a convenience function for reporting non-fatal errors in one --- branch a @case@, or similar scenarios when there is no meaningful --- result but a placeholder of sorts is needed in order to continue. -disclose :: (Default a, Semigroup c, Monad m) => c -> ChronicleT c m a -disclose c = dictate c >> return def - -- | @'confess' c@ is an action that ends with a final output @c@. -- -- Equivalent to 'throwError' for the 'Error' monad. diff --git a/semialign/semialign.cabal b/semialign/semialign.cabal index 5296d46..9b80cb6 100644 --- a/semialign/semialign.cabal +++ b/semialign/semialign.cabal @@ -28,9 +28,10 @@ tested-with: || ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.5 - || ==9.8.2 + || ==9.6.6 + || ==9.8.4 || ==9.10.1 + || ==9.12.1 source-repository head type: git @@ -61,7 +62,7 @@ library -- ghc boot libs build-depends: - base >=4.12.0.0 && <4.21 + base >=4.12.0.0 && <4.22 , containers >=0.6.0.1 && <0.8 , transformers >=0.5.6.2 && <0.7 diff --git a/these-lens/these-lens.cabal b/these-lens/these-lens.cabal index 30428c0..72e8ebf 100644 --- a/these-lens/these-lens.cabal +++ b/these-lens/these-lens.cabal @@ -1,6 +1,7 @@ cabal-version: >=1.10 name: these-lens version: 1.0.2 +x-revision: 1 synopsis: Lenses for These homepage: https://github.com/haskellari/these license: BSD3 @@ -18,9 +19,10 @@ tested-with: || ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.5 - || ==9.8.2 + || ==9.6.6 + || ==9.8.4 || ==9.10.1 + || ==9.12.1 source-repository head type: git @@ -34,7 +36,7 @@ library exposed-modules: Data.These.Lens -- ghc boot libs - build-depends: base >=4.12.0.0 && <4.21 + build-depends: base >=4.12.0.0 && <4.22 build-depends: these >=1.2.1 && <1.3 -- other dependencies diff --git a/these-optics/these-optics.cabal b/these-optics/these-optics.cabal index bec9717..ac110b9 100644 --- a/these-optics/these-optics.cabal +++ b/these-optics/these-optics.cabal @@ -1,6 +1,7 @@ cabal-version: >=1.10 name: these-optics version: 1.0.2 +x-revision: 1 synopsis: Optics for These homepage: https://github.com/haskellari/these license: BSD3 @@ -18,9 +19,10 @@ tested-with: || ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.5 - || ==9.8.2 + || ==9.6.6 + || ==9.8.4 || ==9.10.1 + || ==9.12.1 source-repository head type: git @@ -34,7 +36,7 @@ library exposed-modules: Data.These.Optics -- ghc boot libs - build-depends: base >=4.12 && <4.21 + build-depends: base >=4.12 && <4.22 -- these build-depends: these >=1.2.1 && <1.3 diff --git a/these-tests/these-tests.cabal b/these-tests/these-tests.cabal index 8916293..f742143 100644 --- a/these-tests/these-tests.cabal +++ b/these-tests/these-tests.cabal @@ -19,9 +19,10 @@ tested-with: || ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.5 - || ==9.8.2 + || ==9.6.6 + || ==9.8.4 || ==9.10.1 + || ==9.12.1 source-repository head type: git @@ -50,7 +51,7 @@ test-suite test -- library constrained dependencies build-depends: assoc - , base + , base <5 , binary , containers , hashable @@ -70,5 +71,5 @@ test-suite test lattices >=2.2.1 && <2.3 , quickcheck-instances >=0.3.23 && <0.4 , tasty >=1.2 && <1.6 - , tasty-quickcheck >=0.10 && <0.11 + , tasty-quickcheck >=0.11 && <0.12 , transformers-compat >=0.6.5 && <0.8 diff --git a/these/these.cabal b/these/these.cabal index c0a008d..aeed723 100644 --- a/these/these.cabal +++ b/these/these.cabal @@ -1,7 +1,7 @@ cabal-version: >=1.10 name: these version: 1.2.1 -x-revision: 1 +x-revision: 2 synopsis: An either-or-both data type. homepage: https://github.com/haskellari/these license: BSD3 @@ -38,9 +38,10 @@ tested-with: || ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.5 - || ==9.8.2 + || ==9.6.6 + || ==9.8.4 || ==9.10.1 + || ==9.12.1 source-repository head type: git @@ -58,7 +59,7 @@ library -- ghc boot libs build-depends: - base >=4.12.0.0 && <4.21 + base >=4.12.0.0 && <4.22 , binary >=0.8.6.0 && <0.10 , deepseq >=1.4.4.0 && <1.6