From 0ebdd423182f0f7f56fb563ab11c9d559800878e Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Thu, 16 May 2024 20:45:57 +0300 Subject: [PATCH] Support GHC-8.6.5...GHC-9.10.1 --- .github/workflows/haskell-ci-deprecated.yml | 327 ------------------- .github/workflows/haskell-ci.yml | 211 ++++-------- cabal.deprecated.haskell-ci | 6 - cabal.deprecated.project | 11 - cabal.haskell-ci | 5 - cabal.project | 3 + gen-haskell-ci.sh | 5 - monad-chronicle/CHANGELOG.md | 8 +- monad-chronicle/monad-chronicle.cabal | 51 +-- semialign-indexed/CHANGELOG.md | 13 - semialign-indexed/LICENSE | 30 -- semialign-indexed/cabal.project | 5 - semialign-indexed/semialign-indexed.cabal | 53 --- semialign-optics/CHANGELOG.md | 8 - semialign-optics/LICENSE | 30 -- semialign-optics/cabal.project | 5 - semialign-optics/semialign-optics.cabal | 41 --- semialign/CHANGELOG.md | 4 + semialign/semialign.cabal | 72 ++-- semialign/src/Data/Crosswalk.hs | 6 - semialign/src/Data/Semialign/Internal.hs | 62 +--- semialign/src/Data/Zip.hs | 2 - these-lens/CHANGELOG.md | 4 + these-lens/src/Data/These/Lens.hs | 2 +- these-lens/these-lens.cabal | 36 +- these-optics/CHANGELOG.md | 4 + these-optics/these-optics.cabal | 36 +- these-tests/test/Tests/AlignWrong.hs | 3 +- these-tests/test/Tests/Crosswalk.hs | 13 +- these-tests/test/Tests/Orphans.hs | 21 +- these-tests/test/Tests/Semialign.hs | 32 +- these-tests/test/Tests/SemialignWithIndex.hs | 17 +- these-tests/test/Tests/These.hs | 12 +- these-tests/these-tests.cabal | 45 +-- these/CHANGELOG.md | 4 + these/src/Data/Functor/These.hs | 87 +---- these/src/Data/These.hs | 66 +--- these/src/Data/These/Combinators.hs | 29 -- these/these.cabal | 60 +--- 39 files changed, 213 insertions(+), 1216 deletions(-) delete mode 100644 .github/workflows/haskell-ci-deprecated.yml delete mode 100644 cabal.deprecated.haskell-ci delete mode 100644 cabal.deprecated.project delete mode 100755 gen-haskell-ci.sh delete mode 100644 semialign-indexed/CHANGELOG.md delete mode 100644 semialign-indexed/LICENSE delete mode 100644 semialign-indexed/cabal.project delete mode 100644 semialign-indexed/semialign-indexed.cabal delete mode 100644 semialign-optics/CHANGELOG.md delete mode 100644 semialign-optics/LICENSE delete mode 100644 semialign-optics/cabal.project delete mode 100644 semialign-optics/semialign-optics.cabal diff --git a/.github/workflows/haskell-ci-deprecated.yml b/.github/workflows/haskell-ci-deprecated.yml deleted file mode 100644 index 7eef5ca..0000000 --- a/.github/workflows/haskell-ci-deprecated.yml +++ /dev/null @@ -1,327 +0,0 @@ -# This GitHub workflow config has been generated by a script via -# -# haskell-ci 'github' '--project' 'cabal.deprecated.project' '-o' '.github/workflows/haskell-ci-deprecated.yml' '--config' 'cabal.deprecated.haskell-ci' -# -# To regenerate the script (for example after adjusting tested-with) run -# -# haskell-ci regenerate -# -# For more information, see https://github.com/haskell-CI/haskell-ci -# -# version: 0.17.20231010 -# -# REGENDATA ("0.17.20231010",["github","--project","cabal.deprecated.project","-o",".github/workflows/haskell-ci-deprecated.yml","--config","cabal.deprecated.haskell-ci"]) -# -name: Deprecated Packages -on: - push: - branches: - - master - pull_request: - branches: - - master -jobs: - linux: - name: Deprecated Packages - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-20.04 - timeout-minutes: - 60 - container: - image: buildpack-deps:bionic - continue-on-error: ${{ matrix.allow-failure }} - strategy: - matrix: - include: - - compiler: ghcjs-8.4 - compilerKind: ghcjs - compilerVersion: "8.4" - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-9.8.1 - compilerKind: ghc - compilerVersion: 9.8.1 - setup-method: ghcup - allow-failure: false - - compiler: ghc-9.6.3 - compilerKind: ghc - compilerVersion: 9.6.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-9.4.7 - compilerKind: ghc - compilerVersion: 9.4.7 - setup-method: ghcup - allow-failure: false - - compiler: ghc-9.2.8 - compilerKind: ghc - compilerVersion: 9.2.8 - setup-method: ghcup - allow-failure: false - - compiler: ghc-9.0.2 - compilerKind: ghc - compilerVersion: 9.0.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.10.7 - compilerKind: ghc - compilerVersion: 8.10.7 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.8.4 - compilerKind: ghc - compilerVersion: 8.8.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.6.5 - compilerKind: ghc - compilerVersion: 8.6.5 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.2.2 - compilerKind: ghc - compilerVersion: 8.2.2 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.0.2 - compilerKind: ghc - compilerVersion: 8.0.2 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.10.3 - compilerKind: ghc - compilerVersion: 7.10.3 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.8.4 - compilerKind: ghc - compilerVersion: 7.8.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.6.3 - compilerKind: ghc - compilerVersion: 7.6.3 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.4.2 - compilerKind: ghc - compilerVersion: 7.4.2 - setup-method: hvr-ppa - allow-failure: false - fail-fast: false - steps: - - name: Set GHCJS environment variables - run: | - if [ $HCKIND = ghcjs ]; then - echo "GHCJS=true" >> "$GITHUB_ENV" - echo "GHCJSARITH=1" >> "$GITHUB_ENV" - else - echo "GHCJS=false" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" - fi - env: - HCKIND: ${{ matrix.compilerKind }} - HCNAME: ${{ matrix.compiler }} - HCVER: ${{ matrix.compilerVersion }} - - name: apt - run: | - apt-get update - 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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x bionic main' ; fi - apt-get update - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi - env: - HCKIND: ${{ matrix.compilerKind }} - HCNAME: ${{ matrix.compiler }} - HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi - 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 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - - 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" - env: - HCKIND: ${{ matrix.compilerKind }} - HCNAME: ${{ matrix.compiler }} - HCVER: ${{ matrix.compilerVersion }} - - name: env - run: | - env - - name: write cabal config - run: | - mkdir -p $CABAL_DIR - cat >> $CABAL_CONFIG <> $CABAL_CONFIG < cabal-plan.xz - echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - cabal-plan --version - - name: checkout - uses: actions/checkout@v3 - with: - path: source - - name: initial cabal.project for sdist - run: | - touch cabal.project - echo "packages: $GITHUB_WORKSPACE/source/these" >> cabal.project - echo "packages: $GITHUB_WORKSPACE/source/semialign" >> cabal.project - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/semialign-indexed" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/semialign-optics" >> cabal.project ; fi - cat cabal.project - - name: sdist - run: | - mkdir -p sdist - $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist - - name: unpack - run: | - mkdir -p unpacked - find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; - - name: generate cabal.project - run: | - PKGDIR_these="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/these-[0-9.]*')" - echo "PKGDIR_these=${PKGDIR_these}" >> "$GITHUB_ENV" - PKGDIR_semialign="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/semialign-[0-9.]*')" - echo "PKGDIR_semialign=${PKGDIR_semialign}" >> "$GITHUB_ENV" - PKGDIR_semialign_indexed="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/semialign-indexed-[0-9.]*')" - echo "PKGDIR_semialign_indexed=${PKGDIR_semialign_indexed}" >> "$GITHUB_ENV" - PKGDIR_semialign_optics="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/semialign-optics-[0-9.]*')" - echo "PKGDIR_semialign_optics=${PKGDIR_semialign_optics}" >> "$GITHUB_ENV" - rm -f cabal.project cabal.project.local - touch cabal.project - touch cabal.project.local - echo "packages: ${PKGDIR_these}" >> cabal.project - echo "packages: ${PKGDIR_semialign}" >> cabal.project - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: ${PKGDIR_semialign_indexed}" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: ${PKGDIR_semialign_optics}" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package these" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package semialign" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then echo "package semialign-indexed" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then echo "package semialign-optics" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - cat >> cabal.project <> cabal.project.local - cat cabal.project - cat cabal.project.local - - name: dump install plan - run: | - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all - cabal-plan - - name: restore cache - uses: actions/cache/restore@v3 - with: - key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} - path: ~/.cabal/store - restore-keys: ${{ runner.os }}-${{ matrix.compiler }}- - - name: build w/o tests - run: | - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - - name: build - run: | - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - - name: cabal check - run: | - cd ${PKGDIR_these} || false - ${CABAL} -vnormal check - cd ${PKGDIR_semialign} || false - ${CABAL} -vnormal check - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then cd ${PKGDIR_semialign_indexed} || false ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then cd ${PKGDIR_semialign_optics} || false ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200 && HCNUMVER < 90600)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi - - name: haddock - run: | - if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi - - name: unconstrained build - run: | - rm -f cabal.project.local - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - - name: save cache - uses: actions/cache/save@v3 - if: always() - with: - key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} - path: ~/.cabal/store diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 041c935..3260dc6 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.17.20231010 +# version: 0.19.20240514 # -# REGENDATA ("0.17.20231010",["github","cabal.project"]) +# REGENDATA ("0.19.20240514",["github","cabal.project"]) # name: Haskell-CI on: @@ -27,29 +27,29 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: - - compiler: ghcjs-8.4 - compilerKind: ghcjs - compilerVersion: "8.4" - setup-method: hvr-ppa + - compiler: ghc-9.10.1 + compilerKind: ghc + compilerVersion: 9.10.1 + setup-method: ghcup allow-failure: false - - compiler: ghc-9.8.1 + - compiler: ghc-9.8.2 compilerKind: ghc - compilerVersion: 9.8.1 + compilerVersion: 9.8.2 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.3 + - compiler: ghc-9.6.5 compilerKind: ghc - compilerVersion: 9.6.3 + compilerVersion: 9.6.5 setup-method: ghcup allow-failure: false - - compiler: ghc-9.4.7 + - compiler: ghc-9.4.8 compilerKind: ghc - compilerVersion: 9.4.7 + compilerVersion: 9.4.8 setup-method: ghcup allow-failure: false - compiler: ghc-9.2.8 @@ -70,85 +70,24 @@ jobs: - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.6.5 compilerKind: ghc compilerVersion: 8.6.5 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.2.2 - compilerKind: ghc - compilerVersion: 8.2.2 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.0.2 - compilerKind: ghc - compilerVersion: 8.0.2 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.10.3 - compilerKind: ghc - compilerVersion: 7.10.3 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.8.4 - compilerKind: ghc - compilerVersion: 7.8.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.6.3 - compilerKind: ghc - compilerVersion: 7.6.3 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.4.2 - compilerKind: ghc - compilerVersion: 7.4.2 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false fail-fast: false steps: - - name: Set GHCJS environment variables - run: | - if [ $HCKIND = ghcjs ]; then - echo "GHCJS=true" >> "$GITHUB_ENV" - echo "GHCJSARITH=1" >> "$GITHUB_ENV" - else - echo "GHCJS=false" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" - fi - env: - HCKIND: ${{ matrix.compilerKind }} - HCNAME: ${{ matrix.compiler }} - HCVER: ${{ matrix.compilerVersion }} - name: apt run: | apt-get update 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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x bionic main' ; fi - apt-get update - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + 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" + chmod a+x "$HOME/.ghcup/bin/ghcup" + "$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) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -156,33 +95,24 @@ jobs: - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi 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 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - + 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 +149,6 @@ jobs: $HC --version || true $HC --print-project-git-commit-id || true $CABAL --version || true - if [ $((GHCJSARITH)) -ne 0 ] ; then node --version ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then echo $GHCJS ; fi - name: update cabal index run: | $CABAL v2-update -v @@ -234,15 +162,15 @@ jobs: chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: source - name: initial cabal.project for sdist run: | touch cabal.project echo "packages: $GITHUB_WORKSPACE/source/these" >> cabal.project - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/these-lens" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/these-optics" >> cabal.project ; fi + echo "packages: $GITHUB_WORKSPACE/source/these-lens" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/these-optics" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/semialign" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/monad-chronicle" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/these-tests" >> cabal.project @@ -273,26 +201,28 @@ jobs: touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_these}" >> cabal.project - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000)) -ne 0 ] ; then echo "packages: ${PKGDIR_these_lens}" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000)) -ne 0 ] ; then echo "packages: ${PKGDIR_these_optics}" >> cabal.project ; fi + echo "packages: ${PKGDIR_these_lens}" >> cabal.project + echo "packages: ${PKGDIR_these_optics}" >> cabal.project echo "packages: ${PKGDIR_semialign}" >> cabal.project echo "packages: ${PKGDIR_monad_chronicle}" >> cabal.project echo "packages: ${PKGDIR_these_tests}" >> cabal.project - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package these" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package these-lens" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package these-optics" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package semialign" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package monad-chronicle" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package these-tests" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + echo "package these" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package these-lens" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package these-optics" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package semialign" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package monad-chronicle" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package these-tests" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(monad-chronicle|semialign|these|these-lens|these-optics|these-tests)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -300,7 +230,7 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - name: restore cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -313,27 +243,15 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - name: tests run: | - if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi - pkgdir() { - case $1 in - these) echo ${PKGDIR_these} ;; - these-lens) echo ${PKGDIR_these_lens} ;; - these-optics) echo ${PKGDIR_these_optics} ;; - semialign) echo ${PKGDIR_semialign} ;; - monad-chronicle) echo ${PKGDIR_monad_chronicle} ;; - these-tests) echo ${PKGDIR_these_tests} ;; - esac - } - - if [ $((GHCJSARITH)) -ne 0 ] ; then cabal-plan list-bins '*:test:*' | while read -r line; do testpkg=$(echo "$line" | perl -pe 's/:.*//'); testexe=$(echo "$line" | awk '{ print $2 }'); echo "testing $textexe in package $textpkg"; (cd "$(pkgdir $testpkg)" && nodejs "$testexe".jsexe/all.js); done ; fi + $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: cabal check run: | cd ${PKGDIR_these} || false ${CABAL} -vnormal check - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000)) -ne 0 ] ; then cd ${PKGDIR_these_lens} || false ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000)) -ne 0 ] ; then cd ${PKGDIR_these_optics} || false ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi + cd ${PKGDIR_these_lens} || false + ${CABAL} -vnormal check + cd ${PKGDIR_these_optics} || false + ${CABAL} -vnormal check cd ${PKGDIR_semialign} || false ${CABAL} -vnormal check cd ${PKGDIR_monad_chronicle} || false @@ -342,7 +260,7 @@ jobs: ${CABAL} -vnormal check - name: haddock run: | - if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi + $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - name: unconstrained build run: | rm -f cabal.project.local @@ -352,26 +270,21 @@ jobs: rm -f cabal.project.local - name: constraint set mtl-2.3 run: | - if [ $((! GHCJSARITH && HCNUMVER >= 80600 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='mtl ^>=2.3' --constraint='transformers <0.6' all --dry-run ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80600 && HCNUMVER < 90600)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80600 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='mtl ^>=2.3' --constraint='transformers <0.6' all ; fi + if [ $((HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='mtl ^>=2.3' --constraint='transformers <0.6' all --dry-run ; fi + if [ $((HCNUMVER < 90600)) -ne 0 ] ; then cabal-plan topo | sort ; fi + if [ $((HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='mtl ^>=2.3' --constraint='transformers <0.6' all ; fi - name: constraint set transformers-0.6 run: | - if [ $((! GHCJSARITH && HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all --dry-run ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80600)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all ; fi - - name: constraint set optics-0.3 - run: | - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='optics-core ^>=0.3' all --dry-run ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90600)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='optics-core ^>=0.3' all ; fi + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all --dry-run + cabal-plan topo | sort + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all - name: constraint set light run: | $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='monad-chronicle -semigroupoids' --constraint='semialign -semigroupoids' all --dry-run 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@v3 + uses: actions/cache/save@v4 if: always() with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} diff --git a/cabal.deprecated.haskell-ci b/cabal.deprecated.haskell-ci deleted file mode 100644 index 9248b60..0000000 --- a/cabal.deprecated.haskell-ci +++ /dev/null @@ -1,6 +0,0 @@ -github-action-name: Deprecated Packages -branches: master -jobs-selection: any - --- quickcheck-instances makes a loop -install-dependencies: False diff --git a/cabal.deprecated.project b/cabal.deprecated.project deleted file mode 100644 index 52fa44a..0000000 --- a/cabal.deprecated.project +++ /dev/null @@ -1,11 +0,0 @@ -packages: these -packages: semialign -packages: semialign-indexed -packages: semialign-optics - -tests: true - --- needs these release and propagation of constraints -allow-newer: *:assoc -allow-newer: *:these -allow-newer: *:semialign diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 9323826..1d9148f 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -12,11 +12,6 @@ constraint-set light constraints: monad-chronicle -semigroupoids constraints: semialign -semigroupoids --- No 9.6 cause lens fails top build -constraint-set optics-0.3 - ghc: >=8.0 && <9.6 - constraints: optics-core ^>=0.3 - constraint-set transformers-0.6 ghc: >=8.6 constraints: transformers ^>=0.6 diff --git a/cabal.project b/cabal.project index 5e14f00..625325f 100644 --- a/cabal.project +++ b/cabal.project @@ -6,3 +6,6 @@ packages: monad-chronicle packages: these-tests tests: true + +allow-newer: quickcheck-instances:base +allow-newer: quickcheck-instances:containers diff --git a/gen-haskell-ci.sh b/gen-haskell-ci.sh deleted file mode 100755 index 2e1cbfb..0000000 --- a/gen-haskell-ci.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# haskell-ci doesn't know how to regenerate multiple GHA workflows -haskell-ci github cabal.project -haskell-ci github --project cabal.deprecated.project -o .github/workflows/haskell-ci-deprecated.yml --config cabal.deprecated.haskell-ci diff --git a/monad-chronicle/CHANGELOG.md b/monad-chronicle/CHANGELOG.md index 9ee97d1..5472809 100644 --- a/monad-chronicle/CHANGELOG.md +++ b/monad-chronicle/CHANGELOG.md @@ -1,7 +1,11 @@ +# 1.0.2 + +- Support GHC-8.6.5...GHC-9.10.1 + # 1.0.1 -Support `transformers-0.6` and `mtl-2.3` +- Support `transformers-0.6` and `mtl-2.3` # 1 -Split out of `these` package. +- Split out of `these` package. diff --git a/monad-chronicle/monad-chronicle.cabal b/monad-chronicle/monad-chronicle.cabal index 32f630e..4ceec73 100644 --- a/monad-chronicle/monad-chronicle.cabal +++ b/monad-chronicle/monad-chronicle.cabal @@ -1,7 +1,6 @@ cabal-version: >=1.10 name: monad-chronicle -version: 1.0.1 -x-revision: 3 +version: 1.0.2 synopsis: These as a transformer, ChronicleT homepage: https://github.com/haskellari/these license: BSD3 @@ -17,22 +16,15 @@ description: transformer bells and whistles. tested-with: - GHC ==7.4.2 - || ==7.6.3 - || ==7.8.4 - || ==7.10.3 - || ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.7 - || ==9.0.2 - || ==9.2.8 - || ==9.4.7 - || ==9.6.3 - || ==9.8.1 - , GHCJS ==8.4 + GHC ==8.6.5 + || ==8.8.4 + || ==8.10.7 + || ==9.0.2 + || ==9.2.8 + || ==9.4.8 + || ==9.6.5 + || ==9.8.2 + || ==9.10.1 source-repository head type: git @@ -45,11 +37,7 @@ flag semigroupoids library default-language: Haskell2010 - ghc-options: -Wall - - if impl(ghc >=8.0) - ghc-options: -Wno-trustworthy-safe - + ghc-options: -Wall -Wno-trustworthy-safe hs-source-dirs: src exposed-modules: Control.Monad.Chronicle @@ -58,23 +46,16 @@ library -- ghc boot libs build-depends: - base >=4.5.1.0 && <4.20 - , mtl >=2.1.3 && <2.4 - , transformers >=0.3.0.0 && <0.7 + base >=4.12.0.0 && <4.21 + , mtl >=2.2.2 && <2.4 + , transformers >=0.5.6.2 && <0.7 - build-depends: these >=1 && <1.3 + 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 - if !impl(ghc >=8.0) - build-depends: semigroups >=0.18.5 && <0.21 - - -- Ensure Data.Functor.Classes is always available - if impl(ghc >=7.10) - build-depends: transformers >=0.4.2.0 - if flag(semigroupoids) - build-depends: semigroupoids >=5.3.2 && <6.1 + build-depends: semigroupoids >=6.0.1 && <6.1 diff --git a/semialign-indexed/CHANGELOG.md b/semialign-indexed/CHANGELOG.md deleted file mode 100644 index 3f33d99..0000000 --- a/semialign-indexed/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# 1.2 - -- Deprecated in favor of `semialign-1.2` - Indexed classes use `FunctorWithIndex` from `indexed-traversable` - -# 1.1 - -- Split `ZipWithIndex` out of `SemialignWithIndex` -- Compatible `semialign-1.1`. - -# 1 - -Split out of `these` package. diff --git a/semialign-indexed/LICENSE b/semialign-indexed/LICENSE deleted file mode 100644 index 9d6d650..0000000 --- a/semialign-indexed/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2012, C. McCann, 2015-2019 Oleg Grenrus - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of C. McCann nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/semialign-indexed/cabal.project b/semialign-indexed/cabal.project deleted file mode 100644 index 56d3ee3..0000000 --- a/semialign-indexed/cabal.project +++ /dev/null @@ -1,5 +0,0 @@ -packages: . -packages: ../these -packages: ../semialign -tests: False -benchmarks: False diff --git a/semialign-indexed/semialign-indexed.cabal b/semialign-indexed/semialign-indexed.cabal deleted file mode 100644 index 67da279..0000000 --- a/semialign-indexed/semialign-indexed.cabal +++ /dev/null @@ -1,53 +0,0 @@ -cabal-version: 1.22 -name: semialign-indexed -version: 1.2 -x-revision: 2 -synopsis: SemialignWithIndex, i.e. izipWith and ialignWith -homepage: https://github.com/haskellari/these -license: BSD3 -license-file: LICENSE -author: C. McCann, Oleg Grenrus -maintainer: Oleg Grenrus -category: Data, These -build-type: Simple -extra-source-files: CHANGELOG.md -description: - This package is deprecated. - It simply re-exports [semialign](https://hackage.haskell.org/package/semialign) - (and adds a @lens@ constraint). - . - This package provided @SemialignWithIndex@ with two members - . - @ - class (FunctorWithIndex i f, Semialign f) => SemialignWithIndex i f | f -> i where - \ ialignWith :: (i -> These a b -> c) -> f a -> f b -> f c - @ - . - @ - class (SemialignWithIndex i f, Zip f) => ZipWithIndex i f | f -> i where - \ izipWith :: (i -> a -> b -> c) -> f a -> f b -> f c - @ - -tested-with: - GHC ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.7 - || ==9.0.2 - || ==9.2.8 - || ==9.4.7 - , GHCJS ==8.4 - -source-repository head - type: git - location: https://github.com/haskellari/these.git - subdir: semialign-indexed - -library - default-language: Haskell2010 - ghc-options: -Wall - reexported-modules: Data.Semialign.Indexed - build-depends: base >=4.10.0.0 && <4.19 - build-depends: semialign >=1.2 && <1.3.1 - build-depends: lens ==5.* diff --git a/semialign-optics/CHANGELOG.md b/semialign-optics/CHANGELOG.md deleted file mode 100644 index 035c834..0000000 --- a/semialign-optics/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# 1.2 - -- Deprecated in favor of `semialign-1.2` - Indexed classes use `FunctorWithIndex` from `indexed-traversable` - -# 1.1 - -Initial release diff --git a/semialign-optics/LICENSE b/semialign-optics/LICENSE deleted file mode 100644 index 9d6d650..0000000 --- a/semialign-optics/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2012, C. McCann, 2015-2019 Oleg Grenrus - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of C. McCann nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/semialign-optics/cabal.project b/semialign-optics/cabal.project deleted file mode 100644 index 56d3ee3..0000000 --- a/semialign-optics/cabal.project +++ /dev/null @@ -1,5 +0,0 @@ -packages: . -packages: ../these -packages: ../semialign -tests: False -benchmarks: False diff --git a/semialign-optics/semialign-optics.cabal b/semialign-optics/semialign-optics.cabal deleted file mode 100644 index 220442d..0000000 --- a/semialign-optics/semialign-optics.cabal +++ /dev/null @@ -1,41 +0,0 @@ -cabal-version: 1.22 -name: semialign-optics -version: 1.2 -x-revision: 3 -synopsis: SemialignWithIndex, i.e. izipWith and ialignWith -homepage: https://github.com/haskellari/these -license: BSD3 -license-file: LICENSE -author: C. McCann, Oleg Grenrus -maintainer: Oleg Grenrus -category: Data, These -build-type: Simple -extra-source-files: CHANGELOG.md -description: - This package is deprecated. - It simply re-exports [semialign](https://hackage.haskell.org/package/semialign) - (and adds a @optics-core@ constraint). - -tested-with: - GHC ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.7 - || ==9.0.2 - || ==9.2.8 - || ==9.4.7 - , GHCJS ==8.4 - -source-repository head - type: git - location: https://github.com/haskellari/these.git - subdir: semialign-optics - -library - default-language: Haskell2010 - ghc-options: -Wall - reexported-modules: Data.Semialign.Indexed - build-depends: base >=4.10.0.0 && <4.19 - build-depends: semialign >=1.2 && <1.3.1 - build-depends: optics-core ==0.4.* diff --git a/semialign/CHANGELOG.md b/semialign/CHANGELOG.md index 08be226..8f362ce 100644 --- a/semialign/CHANGELOG.md +++ b/semialign/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.3.1 + +- Support GHC-8.6.5...GHC-9.10.1 + # 1.3 - Depend on `bifunctor-classes-compat` instead of `bifunctors` diff --git a/semialign/semialign.cabal b/semialign/semialign.cabal index e13bdcd..744872e 100644 --- a/semialign/semialign.cabal +++ b/semialign/semialign.cabal @@ -1,7 +1,6 @@ cabal-version: >=1.10 name: semialign -version: 1.3 -x-revision: 1 +version: 1.3.1 synopsis: Align and Zip type-classes from the common Semialign ancestor. @@ -22,22 +21,15 @@ description: forming lattice-like structure. tested-with: - GHC ==7.4.2 - || ==7.6.3 - || ==7.8.4 - || ==7.10.3 - || ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.7 - || ==9.0.2 - || ==9.2.8 - || ==9.4.7 - || ==9.6.3 - || ==9.8.1 - , GHCJS ==8.4 + GHC ==8.6.5 + || ==8.8.4 + || ==8.10.7 + || ==9.0.2 + || ==9.2.8 + || ==9.4.8 + || ==9.6.5 + || ==9.8.2 + || ==9.10.1 source-repository head type: git @@ -51,10 +43,8 @@ flag semigroupoids library default-language: Haskell2010 - ghc-options: -Wall + ghc-options: -Wall -Wno-trustworthy-safe - if impl(ghc >=8.0) - ghc-options: -Wno-trustworthy-safe if impl(ghc >=9.2) ghc-options: -Wno-noncanonical-monoid-instances @@ -70,41 +60,21 @@ library -- ghc boot libs build-depends: - base >=4.5.1.0 && <4.20 - , containers >=0.4.2.1 && <0.7 - , transformers >=0.3.0.0 && <0.7 + base >=4.12.0.0 && <4.21 + , containers >=0.6.0.1 && <0.8 + , transformers >=0.5.6.2 && <0.7 -- These - build-depends: these >=1.2 && <1.3 + build-depends: these >=1.2.1 && <1.3 -- other dependencies build-depends: - hashable >=1.2.7.0 && <1.5 - , indexed-traversable >=0.1.1 && <0.2 - , indexed-traversable-instances >=0.1 && <0.2 - , tagged >=0.8.6 && <0.9 + hashable >=1.4.4.0 && <1.5 + , indexed-traversable >=0.1.4 && <0.2 + , indexed-traversable-instances >=0.1.2 && <0.2 + , tagged >=0.8.8 && <0.9 , unordered-containers >=0.2.8.0 && <0.3 - , vector >=0.12.0.2 && <0.14 - - -- base shims - if !impl(ghc >=8.2) - build-depends: bifunctor-classes-compat >=0.1 && <0.2 - - if !impl(ghc >=8.0) - build-depends: - semigroups >=0.18.5 && <0.21 - , transformers >=0.3.0.0 && <0.7 - , transformers-compat >=0.6.5 && <0.8 - - -- Ensure Data.Functor.Classes is always available - if impl(ghc >=7.10) - build-depends: transformers >=0.4.2.0 - - if !impl(ghc >=7.10) - build-depends: void >=0.7.3 && <0.8 - - if impl(ghc <7.5) - build-depends: ghc-prim + , vector >=0.13.0.0 && <0.14 if flag(semigroupoids) - build-depends: semigroupoids >=5.3.2 && <6.1 + build-depends: semigroupoids >=6.0.1 && <6.1 diff --git a/semialign/src/Data/Crosswalk.hs b/semialign/src/Data/Crosswalk.hs index b4eb774..df3d54c 100644 --- a/semialign/src/Data/Crosswalk.hs +++ b/semialign/src/Data/Crosswalk.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE Trustworthy #-} module Data.Crosswalk ( -- * Crosswalk @@ -42,9 +41,7 @@ class (Functor t, Foldable t) => Crosswalk t where sequenceL :: (Align f) => t (f a) -> f (t a) sequenceL = crosswalk id -#if __GLASGOW_HASKELL__ >= 707 {-# MINIMAL crosswalk | sequenceL #-} -#endif instance Crosswalk Identity where crosswalk f (Identity a) = fmap Identity (f a) @@ -106,10 +103,7 @@ class (Bifunctor t, Bifoldable t) => Bicrosswalk t where bisequenceL :: (Align f) => t (f a) (f b) -> f (t a b) bisequenceL = bicrosswalk id id -#if __GLASGOW_HASKELL__ >= 707 {-# MINIMAL bicrosswalk | bisequenceL #-} -#endif - instance Bicrosswalk Either where bicrosswalk f _ (Left x) = Left <$> f x diff --git a/semialign/src/Data/Semialign/Internal.hs b/semialign/src/Data/Semialign/Internal.hs index 04f5521..00d5b0e 100644 --- a/semialign/src/Data/Semialign/Internal.hs +++ b/semialign/src/Data/Semialign/Internal.hs @@ -2,18 +2,16 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE PolyKinds #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE UndecidableInstances #-} -#if __GLASGOW_HASKELL__ >= 706 -{-# LANGUAGE PolyKinds #-} -#endif module Data.Semialign.Internal where import Prelude (Bool (..), Either (..), Eq (..), Functor (fmap), Int, Maybe (..), - Monad (..), Ord (..), Ordering (..), String, error, flip, fst, id, - maybe, snd, uncurry, ($), (++), (.)) + Monad (..), Ord (..), Ordering (..), String, error, flip, fst, id, maybe, + snd, uncurry, ($), (++), (.)) import qualified Prelude as Prelude @@ -45,38 +43,22 @@ import qualified Data.Tree as T import qualified Data.Vector as V import qualified Data.Vector.Fusion.Stream.Monadic as Stream -#if MIN_VERSION_vector(0,11,0) import Data.Vector.Fusion.Bundle.Monadic (Bundle (..)) import qualified Data.Vector.Fusion.Bundle.Monadic as Bundle import qualified Data.Vector.Fusion.Bundle.Size as Bundle -#else -import qualified Data.Vector.Fusion.Stream.Size as Stream -#endif -#if MIN_VERSION_containers(0,5,0) import Data.Map.Lazy (Map) import qualified Data.Map.Lazy as Map import Data.IntMap.Lazy (IntMap) import qualified Data.IntMap.Lazy as IntMap -#if MIN_VERSION_containers(0,5,9) import qualified Data.IntMap.Merge.Lazy as IntMap import qualified Data.Map.Merge.Lazy as Map -#endif - --- containers <0.5 -#else -import Data.Map (Map) -import qualified Data.Map as Map - -import Data.IntMap (IntMap) -import qualified Data.IntMap as IntMap -#endif #if !(MIN_VERSION_base(4,16,0)) import Data.Semigroup (Option (..)) -#endif +#endif import Data.These import Data.These.Combinators @@ -160,9 +142,7 @@ class Functor f => Semialign f where alignWith :: (These a b -> c) -> f a -> f b -> f c alignWith f a b = f <$> align a b -#if __GLASGOW_HASKELL__ >= 707 {-# MINIMAL (align | alignWith) #-} -#endif -- | A unit of 'align'. -- @@ -206,10 +186,7 @@ class Semialign f => Unalign f where unalignWith :: (c -> These a b) -> f c -> (f a, f b) unalignWith f fx = unalign (fmap f fx) -#if __GLASGOW_HASKELL__ >= 707 {-# MINIMAL unalignWith | unalign #-} -#endif - -- | Functors supporting a 'zip' operation that takes the intersection of -- non-uniform shapes. @@ -294,9 +271,7 @@ class Semialign f => Zip f where zipWith :: (a -> b -> c) -> f a -> f b -> f c zipWith f a b = uncurry f <$> zip a b -#if __GLASGOW_HASKELL__ >= 707 {-# MINIMAL (zip | zipWith) #-} -#endif -- | Zippable functors supporting left and right units -- @@ -337,9 +312,7 @@ class Zip f => Unzip f where unzip :: f (a, b) -> (f a, f b) unzip = unzipWith id -#if __GLASGOW_HASKELL__ >= 707 {-# MINIMAL unzipWith | unzip #-} -#endif unzipDefault :: Functor f => f (a, b) -> (f a, f b) unzipDefault x = (fst <$> x, snd <$> x) @@ -529,12 +502,8 @@ instance Align Seq where nil = Seq.empty instance Unzip Seq where -#if MIN_VERSION_containers(0,5,11) unzip = Seq.unzip unzipWith = Seq.unzipWith -#else - unzip = unzipDefault -#endif instance Zip Seq where zip = Seq.zip @@ -563,17 +532,9 @@ instance Unzip T.Tree where ------------------------------------------------------------------------------- instance Ord k => Semialign (Map k) where -#if MIN_VERSION_containers(0,5,9) alignWith f = Map.merge (Map.mapMissing (\_ x -> f (This x))) (Map.mapMissing (\_ y -> f (That y))) (Map.zipWithMatched (\_ x y -> f (These x y))) -#elif MIN_VERSION_containers(0,5,0) - alignWith f = Map.mergeWithKey (\_ x y -> Just $ f $ These x y) (fmap (f . This)) (fmap (f . That)) -#else - align m n = Map.unionWith merge (Map.map This m) (Map.map That n) - where merge (This a) (That b) = These a b - merge _ _ = oops "Align Map: merge" -#endif instance (Ord k) => Align (Map k) where nil = Map.empty @@ -587,17 +548,9 @@ instance Ord k => Zip (Map k) where zipWith = Map.intersectionWith instance Semialign IntMap where -#if MIN_VERSION_containers(0,5,9) alignWith f = IntMap.merge (IntMap.mapMissing (\_ x -> f (This x))) (IntMap.mapMissing (\_ y -> f (That y))) (IntMap.zipWithMatched (\_ x y -> f (These x y))) -#elif MIN_VERSION_containers(0,5,0) - alignWith f = IntMap.mergeWithKey (\_ x y -> Just $ f $ These x y) (fmap (f . This)) (fmap (f . That)) -#else - align m n = IntMap.unionWith merge (IntMap.map This m) (IntMap.map That n) - where merge (This a) (That b) = These a b - merge _ _ = oops "Align IntMap: merge" -#endif instance Align IntMap where nil = IntMap.empty @@ -722,13 +675,8 @@ instance Monad m => Align (Stream m) where nil = Stream.empty instance Monad m => Semialign (Stream m) where -#if MIN_VERSION_vector(0,11,0) alignWith f (Stream stepa ta) (Stream stepb tb) = Stream step (ta, tb, Nothing, False) -#else - alignWith f (Stream stepa ta na) (Stream stepb tb nb) - = Stream step (ta, tb, Nothing, False) (Stream.larger na nb) -#endif where step (sa, sb, Nothing, False) = do r <- stepa sa @@ -753,14 +701,12 @@ instance Monad m => Semialign (Stream m) where instance Monad m => Zip (Stream m) where zipWith = Stream.zipWith -#if MIN_VERSION_vector(0,11,0) instance Monad m => Align (Bundle m v) where nil = Bundle.empty instance Monad m => Semialign (Bundle m v) where alignWith f Bundle{sElems = sa, sSize = na} Bundle{sElems = sb, sSize = nb} = Bundle.fromStream (alignWith f sa sb) (Bundle.larger na nb) -#endif instance Monad m => Zip (Bundle m v) where zipWith = Bundle.zipWith diff --git a/semialign/src/Data/Zip.hs b/semialign/src/Data/Zip.hs index 4354026..3943329 100644 --- a/semialign/src/Data/Zip.hs +++ b/semialign/src/Data/Zip.hs @@ -50,6 +50,4 @@ instance Repeat f => Applicative (Zippy f) where Zippy f <*> Zippy x = Zippy $ zipWith ($) f x #endif -#if MIN_VERSION_base(4,10,0) liftA2 f (Zippy x) (Zippy y) = Zippy $ zipWith f x y -#endif diff --git a/these-lens/CHANGELOG.md b/these-lens/CHANGELOG.md index 3489b8a..f164714 100644 --- a/these-lens/CHANGELOG.md +++ b/these-lens/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.0.2 + +- Support GHC-8.6.5...GHC-9.10.1 + # 1.0.1.2 - Add `lens-5` support diff --git a/these-lens/src/Data/These/Lens.hs b/these-lens/src/Data/These/Lens.hs index 3832f4c..2c23afb 100644 --- a/these-lens/src/Data/These/Lens.hs +++ b/these-lens/src/Data/These/Lens.hs @@ -11,7 +11,7 @@ module Data.These.Lens ( _This, _That, _These, ) where -import Control.Applicative (pure, (<$>), (<*>)) +import Control.Applicative (pure, (<$>)) import Prelude (Either (..), flip, uncurry, ($), (.)) import Control.Lens (Prism', Traversal, prism) diff --git a/these-lens/these-lens.cabal b/these-lens/these-lens.cabal index d546615..30428c0 100644 --- a/these-lens/these-lens.cabal +++ b/these-lens/these-lens.cabal @@ -1,7 +1,6 @@ cabal-version: >=1.10 name: these-lens -version: 1.0.1.3 -x-revision: 1 +version: 1.0.2 synopsis: Lenses for These homepage: https://github.com/haskellari/these license: BSD3 @@ -13,18 +12,15 @@ build-type: Simple extra-source-files: CHANGELOG.md description: This package provides Prism and Traversals for @These@. tested-with: - GHC ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.7 - || ==9.0.2 - || ==9.2.8 - || ==9.4.7 - || ==9.6.3 - || ==9.8.1 - , GHCJS ==8.4 + GHC ==8.6.5 + || ==8.8.4 + || ==8.10.7 + || ==9.0.2 + || ==9.2.8 + || ==9.4.8 + || ==9.6.5 + || ==9.8.2 + || ==9.10.1 source-repository head type: git @@ -33,17 +29,13 @@ source-repository head library default-language: Haskell2010 - ghc-options: -Wall - - if impl(ghc >=8.0) - ghc-options: -Wno-trustworthy-safe - + ghc-options: -Wall -Wno-trustworthy-safe hs-source-dirs: src exposed-modules: Data.These.Lens -- ghc boot libs - build-depends: base >=4.9 && <4.20 - build-depends: these >=1.2 && <1.3 + build-depends: base >=4.12.0.0 && <4.21 + build-depends: these >=1.2.1 && <1.3 -- other dependencies - build-depends: lens >=5.2.1 && <5.3 + build-depends: lens >=5.2.1 && <5.4 diff --git a/these-optics/CHANGELOG.md b/these-optics/CHANGELOG.md index 3e7a63b..5bd1ca7 100644 --- a/these-optics/CHANGELOG.md +++ b/these-optics/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.0.2 + +- Support GHC-8.6.5...GHC-9.10.1 + # 1.0.1.2 - Support GHC-9.0 diff --git a/these-optics/these-optics.cabal b/these-optics/these-optics.cabal index 6ea2ea2..bec9717 100644 --- a/these-optics/these-optics.cabal +++ b/these-optics/these-optics.cabal @@ -1,7 +1,6 @@ cabal-version: >=1.10 name: these-optics -version: 1.0.1.2 -x-revision: 3 +version: 1.0.2 synopsis: Optics for These homepage: https://github.com/haskellari/these license: BSD3 @@ -13,18 +12,15 @@ build-type: Simple extra-source-files: CHANGELOG.md description: This package provides Prism and Traversals for @These@. tested-with: - GHC ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.7 - || ==9.0.2 - || ==9.2.8 - || ==9.4.7 - || ==9.6.3 - || ==9.8.1 - , GHCJS ==8.4 + GHC ==8.6.5 + || ==8.8.4 + || ==8.10.7 + || ==9.0.2 + || ==9.2.8 + || ==9.4.8 + || ==9.6.5 + || ==9.8.2 + || ==9.10.1 source-repository head type: git @@ -33,19 +29,15 @@ source-repository head library default-language: Haskell2010 - ghc-options: -Wall - - if impl(ghc >=8.0) - ghc-options: -Wno-trustworthy-safe - + ghc-options: -Wall -Wno-trustworthy-safe hs-source-dirs: src exposed-modules: Data.These.Optics -- ghc boot libs - build-depends: base >=4.9 && <4.20 + build-depends: base >=4.12 && <4.21 -- these - build-depends: these >=1 && <1.3 + build-depends: these >=1.2.1 && <1.3 -- other dependencies - build-depends: optics-core >=0.3 && <0.5 + build-depends: optics-core >=0.4.1.1 && <0.5 diff --git a/these-tests/test/Tests/AlignWrong.hs b/these-tests/test/Tests/AlignWrong.hs index 983c45d..8b93d4f 100644 --- a/these-tests/test/Tests/AlignWrong.hs +++ b/these-tests/test/Tests/AlignWrong.hs @@ -2,8 +2,7 @@ {-# LANGUAGE DeriveFunctor #-} module Tests.AlignWrong where -import Prelude () -import Prelude.Compat hiding (zip, zipWith) +import Prelude hiding (zip, zipWith) import Data.Map (Map) import Test.QuickCheck (Arbitrary (..)) diff --git a/these-tests/test/Tests/Crosswalk.hs b/these-tests/test/Tests/Crosswalk.hs index 7b462e5..6a648f5 100644 --- a/these-tests/test/Tests/Crosswalk.hs +++ b/these-tests/test/Tests/Crosswalk.hs @@ -3,15 +3,13 @@ {-# LANGUAGE ScopedTypeVariables #-} module Tests.Crosswalk (crosswalkProps) where -import Prelude () -import Prelude.Compat - import Control.Monad.Trans.Instances () import Data.Functor.Compose (Compose (..)) import Data.Functor.Identity (Identity (..)) import Data.Map (Map) import Data.Semigroup (Semigroup (..)) import Data.Sequence (Seq) +import Data.Typeable (Typeable, typeOf1) import Test.QuickCheck (Arbitrary (..), Property, (===)) import Test.QuickCheck.Function (Fun (..)) import Test.QuickCheck.Instances () @@ -21,13 +19,6 @@ import Test.Tasty.QuickCheck (testProperty) import qualified Data.Vector as V -#if MIN_VERSION_base(4,7,0) -#define Typeable1 Typeable -import Data.Typeable (Typeable, typeOf1) -#else -import Data.Typeable (Typeable1, typeOf1) -#endif - import Data.Crosswalk import Data.Semialign import Data.These @@ -55,7 +46,7 @@ data P (a :: * -> *) = P crosswalkLaws :: forall (t :: * -> *). - ( Typeable1 t, Crosswalk t + ( Typeable t, Crosswalk t , Eq (t A), Show (t A), Arbitrary (t A) , Eq (t B), Show (t B), Arbitrary (t B) ) diff --git a/these-tests/test/Tests/Orphans.hs b/these-tests/test/Tests/Orphans.hs index 3a8471e..e7ae0b1 100644 --- a/these-tests/test/Tests/Orphans.hs +++ b/these-tests/test/Tests/Orphans.hs @@ -1,20 +1 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} -module Tests.Orphans where - -#if !(MIN_VERSION_base(4,7,0)) -import Data.Typeable.Internal -import Data.Functor.Compose (Compose) -import Data.Functor.Product (Product) - -instance (Typeable1 f, Typeable1 g) => Typeable1 (Product f g) where - typeOf1 _ = mkTyConApp - (mkTyCon3 "transformers" "Data.Functor.Product" "Product") - [typeOf1 (undefined :: f ()), typeOf1 (undefined :: f ())] - -instance (Typeable1 f, Typeable1 g) => Typeable1 (Compose f g) where - typeOf1 _ = mkTyConApp - (mkTyCon3 "transformers" "Data.Functor.Compose" "Compose") - [typeOf1 (undefined :: f ()), typeOf1 (undefined :: f ())] -#endif +module Tests.Orphans () where diff --git a/these-tests/test/Tests/Semialign.hs b/these-tests/test/Tests/Semialign.hs index 6c5e095..b7ddd3b 100644 --- a/these-tests/test/Tests/Semialign.hs +++ b/these-tests/test/Tests/Semialign.hs @@ -8,12 +8,13 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} module Tests.Semialign (alignProps, semialignLaws) where -import Prelude () -import Prelude.Compat hiding (repeat, unzip, zip, zipWith) - --- import qualified Prelude.Compat as Prelude +import Prelude hiding (repeat, unzip, zip, zipWith) +import Algebra.Lattice + (BoundedJoinSemiLattice (..), BoundedMeetSemiLattice (..), Lattice (..)) +import Algebra.Lattice.M2 (M2) import Control.Applicative (Const (..), ZipList (..)) +import Control.Lens (folded, toListOf) import Control.Monad (join) import Control.Monad.Trans.Instances () import Data.Bifunctor (bimap) @@ -31,6 +32,7 @@ import Data.Maybe (mapMaybe) import Data.Proxy (Proxy) import Data.Sequence (Seq) import Data.Tagged (Tagged) +import Data.Typeable (Typeable, typeOf1) import Test.QuickCheck (Arbitrary (..), Property, counterexample, (.&&.), (===)) import Test.QuickCheck.Function (Fun (..)) @@ -39,12 +41,6 @@ import Test.QuickCheck.Poly (A, B, C) import Test.Tasty (TestTree, testGroup) import Test.Tasty.QuickCheck (testProperty) -#ifdef MIN_VERSION_lattice -import Algebra.Lattice - (BoundedJoinSemiLattice (..), BoundedMeetSemiLattice (..), Lattice (..)) -import Algebra.Lattice.M2 (M2) -#endif - import qualified Data.Tree as T import qualified Data.Vector as V @@ -52,20 +48,10 @@ import Data.Semialign import Data.These import Data.These.Combinators -#ifdef MIN_VERSION_lens -import Control.Lens (folded, toListOf) import Data.These.Lens -#endif import Tests.Orphans () -#if MIN_VERSION_base(4,7,0) -#define Typeable1 Typeable -import Data.Typeable (Typeable, typeOf1) -#else -import Data.Typeable (Typeable1, typeOf1) -#endif - ------------------------------------------------------------------------------- -- Props ------------------------------------------------------------------------------- @@ -88,17 +74,14 @@ alignProps = testGroup "Align" , semialignLaws (CZip :: CSemialign Identity) , semialignLaws (CUnAll :: CSemialign Proxy) , semialignLaws (CZip :: CSemialign (Tagged Char)) -#ifdef MIN_VERSION_lattice -- note: with e.g. N5 (which isn't distributive lattice) distributivity laws fail! , semialignLaws (CZip :: CSemialign (Const M2)) -#endif ] ------------------------------------------------------------------------------- -- Const ------------------------------------------------------------------------------- -#ifdef MIN_VERSION_lattice instance Lattice a => Semialign (Const a) where alignWith _ (Const a) (Const b) = Const (a \/ b) @@ -116,7 +99,6 @@ instance BoundedJoinSemiLattice a => Align (Const a) where instance BoundedMeetSemiLattice a => Repeat (Const a) where repeat _ = Const top -#endif ------------------------------------------------------------------------------- -- Align laws @@ -132,7 +114,7 @@ data CSemialign f where semialignLaws :: forall (f :: * -> *). - ( Semialign f, Unzip f, Foldable f, Typeable1 f + ( Semialign f, Unzip f, Foldable f, Typeable f , Eq (f A), Show (f A), Arbitrary (f A) , Eq (f B), Show (f B), Arbitrary (f B) , Eq (f C), Show (f C), Arbitrary (f C) diff --git a/these-tests/test/Tests/SemialignWithIndex.hs b/these-tests/test/Tests/SemialignWithIndex.hs index 3baad80..06d30d8 100644 --- a/these-tests/test/Tests/SemialignWithIndex.hs +++ b/these-tests/test/Tests/SemialignWithIndex.hs @@ -1,11 +1,11 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} module Tests.SemialignWithIndex (alignWithKeyProps) where -import Prelude hiding (zip, repeat) +import Prelude hiding (repeat, zip) import Data.Functor.WithIndex (FunctorWithIndex (imap)) +import Data.Typeable (Typeable, typeOf1) import Test.QuickCheck (Arbitrary (..), CoArbitrary, Property, once, (===)) import Test.QuickCheck.Function (Fun (..), Function, applyFun) @@ -27,13 +27,6 @@ import Data.These import Tests.Orphans () -#if MIN_VERSION_base(4,7,0) -#define Typeable1 Typeable -import Data.Typeable (Typeable, typeOf1) -#else -import Data.Typeable (Typeable1, typeOf1) -#endif - ------------------------------------------------------------------------------- -- Props ------------------------------------------------------------------------------- @@ -67,7 +60,7 @@ alignWithKeyProps = testGroup "AlignWithIndex" data P (f :: * -> *) = P repeatIndexedLaws - :: forall f i. (RepeatWithIndex i f, Typeable1 f + :: forall f i. (RepeatWithIndex i f, Typeable f , Function i, CoArbitrary i, Show i , Eq (f A), Show (f A), Arbitrary (f A) , Eq (f B), Show (f B), Arbitrary (f B) @@ -87,7 +80,7 @@ repeatIndexedLaws p = testGroup name $ f = applyFun f' semialignIndexedLaws - :: forall f i. (ZipWithIndex i f, Typeable1 f + :: forall f i. (ZipWithIndex i f, Typeable f , Function i, CoArbitrary i, Show i , Eq (f A), Show (f A), Arbitrary (f A) , Eq (f B), Show (f B), Arbitrary (f B) @@ -100,7 +93,7 @@ semialignIndexedLaws p = testGroup name $ semialignIndexedLaws' p where semialignIndexedLaws' - :: forall f i. (ZipWithIndex i f, Typeable1 f + :: forall f i. (ZipWithIndex i f, Typeable f , Function i, CoArbitrary i, Show i , Eq (f A), Show (f A), Arbitrary (f A) , Eq (f B), Show (f B), Arbitrary (f B) diff --git a/these-tests/test/Tests/These.hs b/these-tests/test/Tests/These.hs index 9373559..a2fb3be 100644 --- a/these-tests/test/Tests/These.hs +++ b/these-tests/test/Tests/These.hs @@ -1,13 +1,9 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module Tests.These (theseProps) where -import Prelude () -import Prelude.Compat - import Control.Applicative (liftA) import Control.Monad (ap, liftM) import Data.Functor.Compose (Compose (..)) @@ -31,12 +27,6 @@ import qualified Data.Map as Map import Data.Align import Data.These -#if MIN_VERSION_base(4,7,0) -#define Typeable1 Typeable -#else -import Data.Typeable (Typeable1) -#endif - theseProps :: TestTree theseProps = testGroup "These" [ functorLaws (CTraversable :: CFunctor (These Int)) @@ -138,7 +128,7 @@ data CFunctor f where CMonad :: (Applicative f, Monad f) => CFunctor f functorLaws - :: forall f. (Typeable1 f + :: forall f. (Typeable f , Eq (f A), Show (f A), Arbitrary (f A) , Eq (f B), Show (f B), Arbitrary (f B) , Eq (f C), Show (f C), Arbitrary (f C) diff --git a/these-tests/these-tests.cabal b/these-tests/these-tests.cabal index 9c3f261..8916293 100644 --- a/these-tests/these-tests.cabal +++ b/these-tests/these-tests.cabal @@ -13,22 +13,15 @@ maintainer: Oleg Grenrus category: Data, Control, These, Tests build-type: Simple tested-with: - GHC ==7.4.2 - || ==7.6.3 - || ==7.8.4 - || ==7.10.3 - || ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.7 - || ==9.0.2 - || ==9.2.8 - || ==9.4.7 - || ==9.6.3 - || ==9.8.1 - , GHCJS ==8.4 + GHC ==8.6.5 + || ==8.8.4 + || ==8.10.7 + || ==9.0.2 + || ==9.2.8 + || ==9.4.8 + || ==9.6.5 + || ==9.8.2 + || ==9.10.1 source-repository head type: git @@ -58,36 +51,24 @@ test-suite test build-depends: assoc , base - , base-compat , binary , containers , hashable , indexed-traversable + , lens , QuickCheck , semialign , tagged , these + , these-lens , transformers , unordered-containers , vector - if impl(ghc >=8.0) - build-depends: - lens - , these-lens - - if !impl(ghc >=8.0) - build-depends: semigroups - - if !impl(ghc >=8.2) - build-depends: bifunctor-classes-compat - -- additional dependencies build-depends: - quickcheck-instances >=0.3.23 && <0.4 + lattices >=2.2.1 && <2.3 + , quickcheck-instances >=0.3.23 && <0.4 , tasty >=1.2 && <1.6 , tasty-quickcheck >=0.10 && <0.11 , transformers-compat >=0.6.5 && <0.8 - - if impl(ghc >=7.6) - build-depends: lattices >=2.2 && <2.3 diff --git a/these/CHANGELOG.md b/these/CHANGELOG.md index 9cab1d5..9b5b8c7 100644 --- a/these/CHANGELOG.md +++ b/these/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.2.1 + +- Support GHC-8.6.5...GHC-9.10.1 + # 1.2 - Depend on `bifunctor-classes-compat` instead of `bifunctors` diff --git a/these/src/Data/Functor/These.hs b/these/src/Data/Functor/These.hs index bd329f4..5d50a63 100644 --- a/these/src/Data/Functor/These.hs +++ b/these/src/Data/Functor/These.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} @@ -7,18 +6,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Safe #-} - -#if MIN_VERSION_base(4,9,0) -#define LIFTED_FUNCTOR_CLASSES 1 -#else -#if MIN_VERSION_transformers (0,5,0) -#define LIFTED_FUNCTOR_CLASSES 1 -#else -#if MIN_VERSION_transformers_compat(0,5,0) && !MIN_VERSION_transformers(0,4,0) -#define LIFTED_FUNCTOR_CLASSES 1 -#endif -#endif -#endif module Data.Functor.These ( These1 (..), ) where @@ -37,20 +24,12 @@ import Prelude import qualified Data.Foldable as F import qualified Data.Foldable1 as F1 -#if MIN_VERSION_deepseq(1,4,3) import Control.DeepSeq (NFData (..), NFData1 (..)) -#else -import Control.DeepSeq (NFData (..)) -#endif -#if __GLASGOW_HASKELL__ >= 706 import GHC.Generics (Generic1) -#endif -#if __GLASGOW_HASKELL__ >= 708 import Data.Data (Data) import Data.Typeable (Typeable) -#endif ------------------------------------------------------------------------------- -- These1 @@ -60,21 +39,13 @@ data These1 f g a = This1 (f a) | That1 (g a) | These1 (f a) (g a) - deriving (Functor, Foldable, Traversable, Generic -#if __GLASGOW_HASKELL__ >= 706 - , Generic1 -#endif -#if __GLASGOW_HASKELL__ >= 708 - , Typeable, Data -#endif - ) + deriving (Functor, Foldable, Traversable, Generic, Generic1, Typeable, Data) ------------------------------------------------------------------------------- -- Eq1 ------------------------------------------------------------------------------- instance (Eq1 f, Eq1 g) => Eq1 (These1 f g) where -#ifdef LIFTED_FUNCTOR_CLASSES liftEq eq (This1 f) (This1 f') = liftEq eq f f' liftEq eq (That1 g) (That1 g') = liftEq eq g g' liftEq eq (These1 f g) (These1 f' g') = liftEq eq f f' && liftEq eq g g' @@ -82,22 +53,12 @@ instance (Eq1 f, Eq1 g) => Eq1 (These1 f g) where liftEq _ This1 {} _ = False liftEq _ That1 {} _ = False liftEq _ These1 {} _ = False -#else - eq1 (This1 f) (This1 f') = eq1 f f' - eq1 (That1 g) (That1 g') = eq1 g g' - eq1 (These1 f g) (These1 f' g') = eq1 f f' && eq1 g g' - - eq1 This1 {} _ = False - eq1 That1 {} _ = False - eq1 These1 {} _ = False -#endif ------------------------------------------------------------------------------- -- Ord1 ------------------------------------------------------------------------------- instance (Ord1 f, Ord1 g) => Ord1 (These1 f g) where -#ifdef LIFTED_FUNCTOR_CLASSES liftCompare cmp (This1 f) (This1 f') = liftCompare cmp f f' liftCompare _cmp (This1 _) _ = LT liftCompare _cmp _ (This1 _) = GT @@ -108,26 +69,12 @@ instance (Ord1 f, Ord1 g) => Ord1 (These1 f g) where liftCompare cmp (These1 f g) (These1 f' g') = liftCompare cmp f f' `mappend` liftCompare cmp g g' -#else - compare1 (This1 f) (This1 f') = compare1 f f' - compare1 (This1 _) _ = LT - compare1 _ (This1 _) = GT - - compare1 (That1 g) (That1 g') = compare1 g g' - compare1 (That1 _) _ = LT - compare1 _ (That1 _) = GT - - compare1 (These1 f g) (These1 f' g') = - compare1 f f' `mappend` compare1 g g' -#endif - ------------------------------------------------------------------------------- -- Show1 ------------------------------------------------------------------------------- instance (Show1 f, Show1 g) => Show1 (These1 f g) where -#ifdef LIFTED_FUNCTOR_CLASSES liftShowsPrec sp sl d (This1 f) = showParen (d > 10) $ showString "This1 " . liftShowsPrec sp sl 11 f @@ -139,26 +86,12 @@ instance (Show1 f, Show1 g) => Show1 (These1 f g) where . liftShowsPrec sp sl 11 f . showChar ' ' . liftShowsPrec sp sl 11 g -#else - showsPrec1 d (This1 f) = showParen (d > 10) - $ showString "This1 " - . showsPrec1 11 f - showsPrec1 d (That1 g) = showParen (d > 10) - $ showString "That1 " - . showsPrec1 11 g - showsPrec1 d (These1 f g) = showParen (d > 10) - $ showString "These1 " - . showsPrec1 11 f - . showChar ' ' - . showsPrec1 11 g -#endif ------------------------------------------------------------------------------- -- Read1 ------------------------------------------------------------------------------- instance (Read1 f, Read1 g) => Read1 (These1 f g) where -#ifdef LIFTED_FUNCTOR_CLASSES liftReadsPrec rp rl d = readParen (d > 10) $ \s0 -> do (t, s1) <- lex s0 case t of @@ -173,22 +106,6 @@ instance (Read1 f, Read1 g) => Read1 (These1 f g) where (y, s3) <- liftReadsPrec rp rl 11 s2 return (These1 x y, s3) _ -> [] -#else - readsPrec1 d = readParen (d > 10) $ \s0 -> do - (t, s1) <- lex s0 - case t of - "This1" -> do - (x, s2) <- readsPrec1 11 s1 - return (This1 x, s2) - "That1" -> do - (y, s2) <- readsPrec1 11 s1 - return (That1 y, s2) - "These1" -> do - (x, s2) <- readsPrec1 11 s1 - (y, s3) <- readsPrec1 11 s2 - return (These1 x y, s3) - _ -> [] -#endif ------------------------------------------------------------------------------- -- Eq, Ord, Show, Read @@ -248,13 +165,11 @@ instance (Read (f a), Read (g a), Read a) => Read (These1 f g a) where -- deepseq ------------------------------------------------------------------------------- -#if MIN_VERSION_deepseq(1,4,3) -- | This instance is available only with @deepseq >= 1.4.3.0@ instance (NFData1 f, NFData1 g) => NFData1 (These1 f g) where liftRnf r (This1 x) = liftRnf r x liftRnf r (That1 y) = liftRnf r y liftRnf r (These1 x y) = liftRnf r x `seq` liftRnf r y -#endif -- | Available always -- diff --git a/these/src/Data/These.hs b/these/src/Data/These.hs index 805a9dd..dd2e641 100644 --- a/these/src/Data/These.hs +++ b/these/src/Data/These.hs @@ -1,22 +1,8 @@ -{-# LANGUAGE CPP #-} --- | The 'These' type and associated operations. Now enhanced with "Control.Lens" magic! +-- | The 'These' type and associated operations. {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Safe #-} - -#if MIN_VERSION_base(4,9,0) -#define LIFTED_FUNCTOR_CLASSES 1 -#else -#if MIN_VERSION_transformers(0,5,0) -#define LIFTED_FUNCTOR_CLASSES 1 -#else -#if MIN_VERSION_transformers_compat(0,5,0) && !MIN_VERSION_transformers(0,4,0) -#define LIFTED_FUNCTOR_CLASSES 1 -#endif -#endif -#endif - module Data.These ( These(..) @@ -41,48 +27,32 @@ module Data.These ( ) where import Control.Applicative (Applicative (..), (<$>)) -import Control.DeepSeq (NFData (..)) +import Control.DeepSeq (NFData (..), NFData1 (..), NFData2 (..)) import Data.Bifoldable (Bifoldable (..)) import Data.Bifoldable1 (Bifoldable1 (..)) import Data.Bifunctor (Bifunctor (..)) +import Data.Bifunctor.Assoc (Assoc (..)) +import Data.Bifunctor.Swap (Swap (..)) import Data.Binary (Binary (..)) import Data.Bitraversable (Bitraversable (..)) import Data.Data (Data, Typeable) import Data.Either (partitionEithers) import Data.Foldable (Foldable (..)) +import Data.Functor.Classes + (Eq1 (..), Eq2 (..), Ord1 (..), Ord2 (..), Read1 (..), Read2 (..), + Show1 (..), Show2 (..)) import Data.Hashable (Hashable (..)) import Data.Hashable.Lifted (Hashable1 (..), Hashable2 (..)) import Data.List.NonEmpty (NonEmpty (..)) import Data.Monoid (Monoid (..)) import Data.Semigroup (Semigroup (..)) import Data.Traversable (Traversable (..)) -import GHC.Generics (Generic) +import GHC.Generics (Generic, Generic1) import Prelude (Bool (..), Either (..), Eq (..), Functor (..), Int, Monad (..), Ord (..), Ordering (..), Read (..), Show (..), fail, id, lex, readParen, seq, showParen, showString, ($), (&&), (.)) -#if MIN_VERSION_deepseq(1,4,3) -import Control.DeepSeq (NFData1 (..), NFData2 (..)) -#endif - -#if __GLASGOW_HASKELL__ >= 706 -import GHC.Generics (Generic1) -#endif - -#ifdef MIN_VERSION_assoc -import Data.Bifunctor.Assoc (Assoc (..)) -import Data.Bifunctor.Swap (Swap (..)) -#endif - -#ifdef LIFTED_FUNCTOR_CLASSES -import Data.Functor.Classes - (Eq1 (..), Eq2 (..), Ord1 (..), Ord2 (..), Read1 (..), Read2 (..), - Show1 (..), Show2 (..)) -#else -import Data.Functor.Classes (Eq1 (..), Ord1 (..), Read1 (..), Show1 (..)) -#endif - -- $setup -- >>> import Control.Lens -- >>> import Data.List.NonEmpty (NonEmpty (..)) @@ -103,11 +73,7 @@ import Data.Functor.Classes (Eq1 (..), Ord1 (..), Read1 (..), Show1 (..)) -- For zipping and unzipping of structures with 'These' values, see -- "Data.Align". data These a b = This a | That b | These a b - deriving (Eq, Ord, Read, Show, Typeable, Data, Generic -#if __GLASGOW_HASKELL__ >= 706 - , Generic1 -#endif - ) + deriving (Eq, Ord, Read, Show, Typeable, Data, Generic, Generic1) ------------------------------------------------------------------------------- -- Eliminators @@ -293,7 +259,6 @@ instance (Semigroup a) => Monad (These a) where -- Data.Functor.Classes ------------------------------------------------------------------------------- -#ifdef LIFTED_FUNCTOR_CLASSES -- | @since 1.1.1 instance Eq2 These where liftEq2 f _ (This a) (This a') = f a a' @@ -360,17 +325,6 @@ instance Read2 These where instance Read a => Read1 (These a) where liftReadsPrec = liftReadsPrec2 readsPrec readList -#else --- | @since 1.1.1 -instance Eq a => Eq1 (These a) where eq1 = (==) --- | @since 1.1.1 -instance Ord a => Ord1 (These a) where compare1 = compare --- | @since 1.1.1 -instance Show a => Show1 (These a) where showsPrec1 = showsPrec --- | @since 1.1.1 -instance Read a => Read1 (These a) where readsPrec1 = readsPrec -#endif - ------------------------------------------------------------------------------- -- assoc ------------------------------------------------------------------------------- @@ -409,7 +363,6 @@ instance (NFData a, NFData b) => NFData (These a b) where rnf (That b) = rnf b rnf (These a b) = rnf a `seq` rnf b -#if MIN_VERSION_deepseq(1,4,3) -- | @since 1.1.1 instance NFData a => NFData1 (These a) where liftRnf _rnfB (This a) = rnf a @@ -421,7 +374,6 @@ instance NFData2 These where liftRnf2 rnfA _rnfB (This a) = rnfA a liftRnf2 _rnfA rnfB (That b) = rnfB b liftRnf2 rnfA rnfB (These a b) = rnfA a `seq` rnfB b -#endif ------------------------------------------------------------------------------- -- binary diff --git a/these/src/Data/These/Combinators.hs b/these/src/Data/These/Combinators.hs index 0599bab..bd25fdb 100644 --- a/these/src/Data/These/Combinators.hs +++ b/these/src/Data/These/Combinators.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE Trustworthy #-} -- | This module provides -- @@ -87,10 +86,8 @@ import Data.Maybe (isJust, mapMaybe) import Data.These import Prelude (Bool (..), Maybe (..), curry, uncurry, (.)) -#ifdef MIN_VERSION_assoc import Data.Bifunctor.Assoc (assoc, unassoc) import Data.Bifunctor.Swap (swap) -#endif -- $setup -- >>> import Data.These @@ -127,13 +124,7 @@ bitraverseThese = bitraverse -- -- @since 0.8 swapThese :: These a b -> These b a -#ifdef MIN_VERSION_assoc swapThese = swap -#else -swapThese (This a) = That a -swapThese (That b) = This b -swapThese (These a b) = These b a -#endif -- | 'These' is associative. -- @@ -144,33 +135,13 @@ swapThese (These a b) = These b a -- -- @since 0.8 assocThese :: These (These a b) c -> These a (These b c) -#ifdef MIN_VERSION_assoc assocThese = assoc -#else -assocThese (This (This a)) = This a -assocThese (This (That b)) = That (This b) -assocThese (That c) = That (That c) -assocThese (These (That b) c) = That (These b c) -assocThese (This (These a b)) = These a (This b) -assocThese (These (This a) c) = These a (That c) -assocThese (These (These a b) c) = These a (These b c) -#endif -- | 'These' is associative. See 'assocThese'. -- -- @since 0.8 unassocThese :: These a (These b c) -> These (These a b) c -#ifdef MIN_VERSION_assoc unassocThese = unassoc -#else -unassocThese (This a) = This (This a) -unassocThese (That (This b)) = This (That b) -unassocThese (That (That c)) = That c -unassocThese (That (These b c)) = These (That b) c -unassocThese (These a (This b)) = This (These a b) -unassocThese (These a (That c)) = These (This a) c -unassocThese (These a (These b c)) = These (These a b) c -#endif ------------------------------------------------------------------------------- -- preview diff --git a/these/these.cabal b/these/these.cabal index 87a373d..711d0c4 100644 --- a/these/these.cabal +++ b/these/these.cabal @@ -1,7 +1,6 @@ cabal-version: >=1.10 name: these -version: 1.2 -x-revision: 1 +version: 1.2.1 synopsis: An either-or-both data type. homepage: https://github.com/haskellari/these license: BSD3 @@ -32,22 +31,15 @@ description: * For transformers variant of @These@. tested-with: - GHC ==7.4.2 - || ==7.6.3 - || ==7.8.4 - || ==7.10.3 - || ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.7 - || ==9.0.2 - || ==9.2.8 - || ==9.4.7 - || ==9.6.3 - || ==9.8.1 - , GHCJS ==8.4 + GHC ==8.6.5 + || ==8.8.4 + || ==8.10.7 + || ==9.0.2 + || ==9.2.8 + || ==9.4.8 + || ==9.6.5 + || ==9.8.2 + || ==9.10.1 source-repository head type: git @@ -56,11 +48,7 @@ source-repository head library default-language: Haskell2010 - ghc-options: -Wall - - if impl(ghc >=8.0) - ghc-options: -Wno-trustworthy-safe - + ghc-options: -Wall -Wno-trustworthy-safe hs-source-dirs: src exposed-modules: Data.Functor.These @@ -69,34 +57,18 @@ library -- ghc boot libs build-depends: - base >=4.5.1.0 && <4.20 - , binary >=0.5.1.0 && <0.10 - , deepseq >=1.3.0.0 && <1.6 + base >=4.12.0.0 && <4.21 + , binary >=0.8.6.0 && <0.10 + , deepseq >=1.4.4.0 && <1.6 -- other dependencies -- note: we need to depend on assoc-1.1 to be sure that -- Bifunctor type class comes from bifunctor-classes-compat build-depends: - assoc >=1.1 && <1.2 - , hashable >=1.2.7.0 && <1.5 - - if impl(ghc <7.5) - build-depends: ghc-prim + assoc >=1.1.1 && <1.2 + , hashable >=1.4.4.0 && <1.5 if !impl(ghc >=9.6) build-depends: foldable1-classes-compat >=0.1 && <0.2 - if !impl(ghc >=8.2) - build-depends: bifunctor-classes-compat >=0.1 && <0.2 - - if !impl(ghc >=8.0) - build-depends: - semigroups >=0.18.5 && <0.21 - , transformers >=0.3.0.0 && <0.7 - , transformers-compat >=0.6.5 && <0.8 - - -- Ensure Data.Functor.Classes is always available - if impl(ghc >=7.10) - build-depends: transformers >=0.4.2.0 - x-docspec-extra-packages: lens