From 2229a7a54695cd777a88c70c06c832cc452244ba Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Thu, 26 May 2022 00:38:45 +0200 Subject: [PATCH] newtype 0.2.2.0 revision 3: allow base >= 4.17 (GHC 9.4) --- .github/workflows/haskell-ci.yml | 46 ++++++++++++++++++++++++-------- CHANGES.md | 4 +++ cabal.haskell-ci | 1 + newtype.cabal | 10 ++++--- 4 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 cabal.haskell-ci diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 61340fa..87ad9a9 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,18 +8,22 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.14.1 +# version: 0.15.20220525 # -# REGENDATA ("0.14.1",["github","newtype.cabal"]) +# REGENDATA ("0.15.20220525",["github","newtype.cabal"]) # name: Haskell-CI on: - - push - - pull_request + push: + branches: + - master + pull_request: + branches: + - master jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 timeout-minutes: 60 container: @@ -28,9 +32,14 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.2.1 + - compiler: ghc-9.4.0.20220501 compilerKind: ghc - compilerVersion: 9.2.1 + compilerVersion: 9.4.0.20220501 + setup-method: ghcup + allow-failure: true + - compiler: ghc-9.2.2 + compilerKind: ghc + compilerVersion: 9.2.2 setup-method: ghcup allow-failure: false - compiler: ghc-9.0.2 @@ -101,8 +110,9 @@ jobs: apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 if [ "${{ matrix.setup-method }}" = ghcup ]; then mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.17.8/x86_64-linux-ghcup-0.1.17.8 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" + if $HEADHACKAGE; then "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; fi "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 else @@ -110,7 +120,7 @@ jobs: apt-get update apt-get install -y "$HCNAME" mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.17.8/x86_64-linux-ghcup-0.1.17.8 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 fi @@ -143,7 +153,7 @@ jobs: echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" - echo "HEADHACKAGE=false" >> "$GITHUB_ENV" + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: @@ -172,6 +182,17 @@ jobs: repository hackage.haskell.org url: http://hackage.haskell.org/ EOF + if $HEADHACKAGE; then + cat >> $CABAL_CONFIG <> $CABAL_CONFIG <= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <> cabal.project + fi $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(newtype)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local @@ -252,7 +276,7 @@ jobs: ${CABAL} -vnormal check - name: haddock run: | - $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all + $CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - name: unconstrained build run: | rm -f cabal.project.local diff --git a/CHANGES.md b/CHANGES.md index e336c84..2682ea0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ See also https://pvp.haskell.org/faq +## 0.2.2.0 + + - Provide safe coerceible based default-methods for pack/unpack + ## 0.2.1.0 *(minor)* - Added `Newtype` instances for diff --git a/cabal.haskell-ci b/cabal.haskell-ci new file mode 100644 index 0000000..e1f1b77 --- /dev/null +++ b/cabal.haskell-ci @@ -0,0 +1 @@ +branches: master diff --git a/newtype.cabal b/newtype.cabal index 9065f4f..ec0b894 100644 --- a/newtype.cabal +++ b/newtype.cabal @@ -1,12 +1,13 @@ cabal-version: 1.12 build-type: Simple name: newtype -version: 0.2.1.0 +version: 0.2.2.0 +x-revision: 3 license: BSD3 license-file: LICENSE author: Herbert Valerio Riedel, Darius Jahandarie, Conor McBride -maintainer: hvr@gnu.org +maintainer: Andreas Abel category: Control bug-reports: https://github.com/hvr/newtype/issues @@ -14,7 +15,8 @@ synopsis: A typeclass and set of functions for working with newtypes. description: Per Conor McBride, the 'Newtype' typeclass represents the packing and unpacking of a @newtype@, and allows you to operate under that @newtype@ with functions such as 'ala'. See "Control.Newtype" for documentation and examples. tested-with: - GHC == 9.2.1 + GHC == 9.4.1 + GHC == 9.2.2 GHC == 9.0.2 GHC == 8.10.7 GHC == 8.8.4 @@ -37,7 +39,7 @@ source-repository head library exposed-modules: Control.Newtype - build-depends: base >= 4.3 && < 4.17 + build-depends: base >= 4.3 && < 5 if !impl(ghc >= 8.0) build-depends: transformers >= 0.2.2.0 && < 0.6