Skip to content

Commit 26d0893

Browse files
authored
Compatibility with hpqtypes 1.13.0.0 (#46)
1 parent 1681c84 commit 26d0893

File tree

6 files changed

+223
-260
lines changed

6 files changed

+223
-260
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 88 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.18.1
11+
# version: 0.19.20251118
1212
#
13-
# REGENDATA ("0.18.1",["github","--config=cabal.haskell-ci","cabal.project"])
13+
# REGENDATA ("0.19.20251118",["github","--config=cabal.haskell-ci","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -20,14 +20,17 @@ on:
2020
pull_request:
2121
branches:
2222
- master
23+
merge_group:
24+
branches:
25+
- master
2326
jobs:
2427
linux:
2528
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-20.04
29+
runs-on: ubuntu-24.04
2730
timeout-minutes:
2831
60
2932
container:
30-
image: buildpack-deps:bionic
33+
image: buildpack-deps:jammy
3134
services:
3235
postgres:
3336
image: postgres:14
@@ -38,72 +41,97 @@ jobs:
3841
strategy:
3942
matrix:
4043
include:
41-
- compiler: ghc-9.8.2
44+
- compiler: ghc-9.14.0.20251104
45+
compilerKind: ghc
46+
compilerVersion: 9.14.0.20251104
47+
setup-method: ghcup-prerelease
48+
allow-failure: false
49+
- compiler: ghc-9.12.2
4250
compilerKind: ghc
43-
compilerVersion: 9.8.2
51+
compilerVersion: 9.12.2
4452
setup-method: ghcup
4553
allow-failure: false
46-
- compiler: ghc-9.6.4
54+
- compiler: ghc-9.10.3
4755
compilerKind: ghc
48-
compilerVersion: 9.6.4
56+
compilerVersion: 9.10.3
4957
setup-method: ghcup
5058
allow-failure: false
51-
- compiler: ghc-9.4.8
59+
- compiler: ghc-9.8.4
5260
compilerKind: ghc
53-
compilerVersion: 9.4.8
61+
compilerVersion: 9.8.4
5462
setup-method: ghcup
5563
allow-failure: false
56-
- compiler: ghc-9.2.8
64+
- compiler: ghc-9.6.7
5765
compilerKind: ghc
58-
compilerVersion: 9.2.8
66+
compilerVersion: 9.6.7
5967
setup-method: ghcup
6068
allow-failure: false
61-
- compiler: ghc-9.0.2
69+
- compiler: ghc-9.4.8
6270
compilerKind: ghc
63-
compilerVersion: 9.0.2
71+
compilerVersion: 9.4.8
6472
setup-method: ghcup
6573
allow-failure: false
66-
- compiler: ghc-8.10.7
74+
- compiler: ghc-9.2.8
6775
compilerKind: ghc
68-
compilerVersion: 8.10.7
76+
compilerVersion: 9.2.8
6977
setup-method: ghcup
7078
allow-failure: false
7179
fail-fast: false
7280
steps:
73-
- name: apt
81+
- name: apt-get install
7482
run: |
7583
apt-get update
7684
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
85+
- name: Install GHCup
86+
run: |
7787
mkdir -p "$HOME/.ghcup/bin"
78-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
88+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
7989
chmod a+x "$HOME/.ghcup/bin/ghcup"
90+
- name: Install cabal-install
91+
run: |
92+
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
93+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
94+
- name: Install GHC (GHCup)
95+
if: matrix.setup-method == 'ghcup'
96+
run: |
8097
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
81-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
98+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
99+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
100+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
101+
echo "HC=$HC" >> "$GITHUB_ENV"
102+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
103+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
82104
env:
83105
HCKIND: ${{ matrix.compilerKind }}
84106
HCNAME: ${{ matrix.compiler }}
85107
HCVER: ${{ matrix.compilerVersion }}
86-
- name: Set PATH and environment variables
108+
- name: Install GHC (GHCup prerelease)
109+
if: matrix.setup-method == 'ghcup-prerelease'
87110
run: |
88-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
89-
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
90-
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
91-
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
92-
HCDIR=/opt/$HCKIND/$HCVER
111+
"$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
112+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
93113
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
94114
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
95115
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
96116
echo "HC=$HC" >> "$GITHUB_ENV"
97117
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
98118
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
99-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
119+
env:
120+
HCKIND: ${{ matrix.compilerKind }}
121+
HCNAME: ${{ matrix.compiler }}
122+
HCVER: ${{ matrix.compilerVersion }}
123+
- name: Set PATH and environment variables
124+
run: |
125+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
126+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
127+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
128+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
100129
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
101130
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
102131
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
103132
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
104-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
133+
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
105134
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
106-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
107135
env:
108136
HCKIND: ${{ matrix.compilerKind }}
109137
HCNAME: ${{ matrix.compiler }}
@@ -130,6 +158,18 @@ jobs:
130158
repository hackage.haskell.org
131159
url: http://hackage.haskell.org/
132160
EOF
161+
if $HEADHACKAGE; then
162+
cat >> $CABAL_CONFIG <<EOF
163+
repository head.hackage.ghc.haskell.org
164+
url: https://ghc.gitlab.haskell.org/head.hackage/
165+
secure: True
166+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
167+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
168+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
169+
key-threshold: 3
170+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
171+
EOF
172+
fi
133173
cat >> $CABAL_CONFIG <<EOF
134174
program-default-options
135175
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -144,9 +184,9 @@ jobs:
144184
run: |
145185
$CABAL v2-update -v
146186
- name: cache (tools)
147-
uses: actions/cache/restore@v3
187+
uses: actions/cache/restore@v4
148188
with:
149-
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-9b3acae5
189+
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-e93c7dce
150190
path: ~/.haskell-ci-tools
151191
- name: install cabal-plan
152192
run: |
@@ -159,16 +199,16 @@ jobs:
159199
cabal-plan --version
160200
- name: install doctest
161201
run: |
162-
$CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22'
163-
doctest --version
202+
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi
203+
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then doctest --version ; fi
164204
- name: save cache (tools)
165-
uses: actions/cache/save@v3
166205
if: always()
206+
uses: actions/cache/save@v4
167207
with:
168-
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-9b3acae5
208+
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-e93c7dce
169209
path: ~/.haskell-ci-tools
170210
- name: checkout
171-
uses: actions/checkout@v3
211+
uses: actions/checkout@v5
172212
with:
173213
path: source
174214
- name: initial cabal.project for sdist
@@ -193,18 +233,25 @@ jobs:
193233
touch cabal.project.local
194234
echo "packages: ${PKGDIR_hpqtypes_effectful}" >> cabal.project
195235
echo "package hpqtypes-effectful" >> cabal.project
196-
echo " ghc-options: -Werror=missing-methods" >> cabal.project
236+
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
237+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package hpqtypes-effectful" >> cabal.project ; fi
238+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
239+
echo "package hpqtypes-effectful" >> cabal.project
240+
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
197241
cat >> cabal.project <<EOF
198242
EOF
199-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(hpqtypes-effectful)$/; }' >> cabal.project.local
243+
if $HEADHACKAGE; then
244+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
245+
fi
246+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(hpqtypes-effectful)$/; }' >> cabal.project.local
200247
cat cabal.project
201248
cat cabal.project.local
202249
- name: dump install plan
203250
run: |
204251
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
205252
cabal-plan
206253
- name: restore cache
207-
uses: actions/cache/restore@v3
254+
uses: actions/cache/restore@v4
208255
with:
209256
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
210257
path: ~/.cabal/store
@@ -224,8 +271,8 @@ jobs:
224271
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
225272
- name: doctest
226273
run: |
227-
cd ${PKGDIR_hpqtypes_effectful} || false
228-
doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators src
274+
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_hpqtypes_effectful} || false ; fi
275+
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XImportQualifiedPost -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators -XUndecidableInstances src ; fi
229276
- name: cabal check
230277
run: |
231278
cd ${PKGDIR_hpqtypes_effectful} || false
@@ -238,8 +285,8 @@ jobs:
238285
rm -f cabal.project.local
239286
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
240287
- name: save cache
241-
uses: actions/cache/save@v3
242288
if: always()
289+
uses: actions/cache/save@v4
243290
with:
244291
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
245292
path: ~/.cabal/store

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# hpqtypes-effectful-1.1.0.0 (????-??-??)
2+
* Compatibility with `hpqtypes` >= 1.13.0.0.
3+
14
# hpqtypes-effectful-1.0.2.0 (2024-03-18)
25
* Compatibility with `hpqtypes` >= 1.12.0.0.
36

examples/OuterJoins.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
module OuterJoins (runApp) where
55

66
import Control.Monad
7-
import Control.Monad.Catch
87
import Data.Int
98
import Data.Pool
10-
import qualified Data.Text as T
9+
import Data.Text qualified as T
1110
import Effectful
11+
import Effectful.Exception
1212
import Effectful.HPQTypes
1313

1414
-- | Generic 'putStrLn'.

hpqtypes-effectful.cabal

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22
build-type: Simple
33
name: hpqtypes-effectful
4-
version: 1.0.2.0
4+
version: 1.1.0.0
55
license: BSD-3-Clause
66
license-file: LICENSE
77
category: Database
@@ -16,7 +16,7 @@ extra-source-files:
1616
CHANGELOG.md
1717
README.md
1818

19-
tested-with: GHC == { 8.10.7, 9.0.2, 9.2.8, 9.4.8, 9.6.4, 9.8.2 }
19+
tested-with: GHC == { 9.2.8, 9.4.8, 9.6.7, 9.8.4, 9.10.3, 9.12.2, 9.14.1 }
2020

2121
bug-reports: https://github.com/haskell-effectful/hpqtypes-effectful/issues
2222
source-repository head
@@ -26,7 +26,7 @@ source-repository head
2626
common language
2727
ghc-options: -Wall -Wcompat -Wredundant-constraints
2828
-Wno-unticked-promoted-constructors
29-
29+
-Werror=prepositive-qualified-module
3030

3131
default-language: Haskell2010
3232

@@ -38,6 +38,7 @@ common language
3838
DerivingStrategies
3939
FlexibleContexts
4040
FlexibleInstances
41+
ImportQualifiedPost
4142
GADTs
4243
GeneralizedNewtypeDeriving
4344
LambdaCase
@@ -51,14 +52,14 @@ common language
5152
TypeApplications
5253
TypeFamilies
5354
TypeOperators
55+
UndecidableInstances
5456

5557
library
5658
import: language
5759

58-
build-depends: base >= 4.14 && < 5
59-
, effectful-core >= 1.2.0.0 && < 3.0.0.0
60-
, exceptions
61-
, hpqtypes >= 1.12.0.0 && < 1.13.0.0
60+
build-depends: base >= 4.16 && < 5
61+
, effectful-core >= 2.5.0.0 && < 3.0.0.0
62+
, hpqtypes >= 1.13.0.0 && < 1.14.0.0
6263

6364
hs-source-dirs: src
6465

@@ -72,8 +73,6 @@ test-suite test
7273
build-depends: base
7374
, effectful-core
7475
, hpqtypes-effectful
75-
, exceptions
76-
, hpqtypes
7776
, resource-pool
7877
, tasty
7978
, tasty-hunit

0 commit comments

Comments
 (0)