Skip to content

Commit 46e2ed4

Browse files
committed
Update tested-with, CI, fix warnings
1 parent 0f70930 commit 46e2ed4

File tree

4 files changed

+55
-58
lines changed

4 files changed

+55
-58
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 43 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,71 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.15.20230217
11+
# version: 0.19.20240708
1212
#
13-
# REGENDATA ("0.15.20230217",["github","cabal.project"])
13+
# REGENDATA ("0.19.20240708",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
17-
- push
18-
- pull_request
17+
push:
18+
branches:
19+
- master
20+
pull_request:
21+
branches:
22+
- master
1923
jobs:
2024
linux:
2125
name: Haskell-CI - Linux - ${{ matrix.compiler }}
2226
runs-on: ubuntu-20.04
2327
timeout-minutes:
2428
60
2529
container:
26-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
2731
continue-on-error: ${{ matrix.allow-failure }}
2832
strategy:
2933
matrix:
3034
include:
31-
- compiler: ghc-9.4.4
35+
- compiler: ghc-9.10.1
3236
compilerKind: ghc
33-
compilerVersion: 9.4.4
37+
compilerVersion: 9.10.1
3438
setup-method: ghcup
3539
allow-failure: false
36-
- compiler: ghc-9.2.5
40+
- compiler: ghc-9.8.2
3741
compilerKind: ghc
38-
compilerVersion: 9.2.5
42+
compilerVersion: 9.8.2
3943
setup-method: ghcup
4044
allow-failure: false
41-
- compiler: ghc-9.0.2
45+
- compiler: ghc-9.6.6
4246
compilerKind: ghc
43-
compilerVersion: 9.0.2
47+
compilerVersion: 9.6.6
4448
setup-method: ghcup
4549
allow-failure: false
46-
- compiler: ghc-8.10.7
50+
- compiler: ghc-9.4.8
4751
compilerKind: ghc
48-
compilerVersion: 8.10.7
52+
compilerVersion: 9.4.8
53+
setup-method: ghcup
54+
allow-failure: false
55+
- compiler: ghc-9.2.8
56+
compilerKind: ghc
57+
compilerVersion: 9.2.8
4958
setup-method: ghcup
5059
allow-failure: false
51-
- compiler: ghc-8.8.4
60+
- compiler: ghc-8.10.7
5261
compilerKind: ghc
53-
compilerVersion: 8.8.4
54-
setup-method: hvr-ppa
62+
compilerVersion: 8.10.7
63+
setup-method: ghcup
5564
allow-failure: false
5665
fail-fast: false
5766
steps:
5867
- name: apt
5968
run: |
6069
apt-get update
6170
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
62-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
63-
mkdir -p "$HOME/.ghcup/bin"
64-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
65-
chmod a+x "$HOME/.ghcup/bin/ghcup"
66-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
67-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
68-
"$HOME/.ghcup/bin/ghcup" install cabal 3.9.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
69-
else
70-
apt-add-repository -y 'ppa:hvr/ghc'
71-
apt-get update
72-
apt-get install -y "$HCNAME"
73-
mkdir -p "$HOME/.ghcup/bin"
74-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
75-
chmod a+x "$HOME/.ghcup/bin/ghcup"
76-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
77-
"$HOME/.ghcup/bin/ghcup" install cabal 3.9.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
78-
fi
71+
mkdir -p "$HOME/.ghcup/bin"
72+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
73+
chmod a+x "$HOME/.ghcup/bin/ghcup"
74+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
75+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
7976
env:
8077
HCKIND: ${{ matrix.compilerKind }}
8178
HCNAME: ${{ matrix.compiler }}
@@ -87,20 +84,13 @@ jobs:
8784
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
8885
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
8986
HCDIR=/opt/$HCKIND/$HCVER
90-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
91-
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
92-
echo "HC=$HC" >> "$GITHUB_ENV"
93-
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
94-
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
95-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.9.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
96-
else
97-
HC=$HCDIR/bin/$HCKIND
98-
echo "HC=$HC" >> "$GITHUB_ENV"
99-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
100-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
101-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.9.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
102-
fi
103-
87+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
88+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
89+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
90+
echo "HC=$HC" >> "$GITHUB_ENV"
91+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
92+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
93+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
10494
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
10595
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
10696
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
@@ -150,14 +140,14 @@ jobs:
150140
- name: install cabal-plan
151141
run: |
152142
mkdir -p $HOME/.cabal/bin
153-
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
154-
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
143+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
144+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
155145
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
156146
rm -f cabal-plan.xz
157147
chmod a+x $HOME/.cabal/bin/cabal-plan
158148
cabal-plan --version
159149
- name: checkout
160-
uses: actions/checkout@v3
150+
uses: actions/checkout@v4
161151
with:
162152
path: source
163153
- name: initial cabal.project for sdist
@@ -185,15 +175,15 @@ jobs:
185175
echo " ghc-options: -Werror=missing-methods" >> cabal.project
186176
cat >> cabal.project <<EOF
187177
EOF
188-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(json-sop)$/; }' >> cabal.project.local
178+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(json-sop)$/; }' >> cabal.project.local
189179
cat cabal.project
190180
cat cabal.project.local
191181
- name: dump install plan
192182
run: |
193183
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
194184
cabal-plan
195185
- name: restore cache
196-
uses: actions/cache/restore@v3
186+
uses: actions/cache/restore@v4
197187
with:
198188
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
199189
path: ~/.cabal/store
@@ -223,7 +213,7 @@ jobs:
223213
rm -f cabal.project.local
224214
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
225215
- name: save cache
226-
uses: actions/cache/save@v3
216+
uses: actions/cache/save@v4
227217
if: always()
228218
with:
229219
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

cabal.haskell-ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
branches: master

json-sop.cabal

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: json-sop
2-
version: 0.2.2
2+
version: 0.2.3
33
synopsis: Generics JSON (de)serialization using generics-sop
44
description:
55
This library contains generic serialization and deserialization functions
@@ -13,7 +13,12 @@ maintainer: [email protected]
1313
category: Generics
1414
build-type: Simple
1515
cabal-version: >=1.10
16-
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.5 || ==9.4.4
16+
tested-with: GHC==8.10.7
17+
, GHC==9.2.8
18+
, GHC==9.4.8
19+
, GHC==9.6.6
20+
, GHC==9.8.2
21+
, GHC==9.10.1
1722

1823
source-repository head
1924
type: git

src/Generics/SOP/Util/PartialResult.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Generics.SOP.Util.PartialResult (
1010
import Control.Applicative
1111
import Control.Monad
1212
import Control.Monad.Trans.Class
13+
import Data.Kind
1314

1415
-- | Repeat f zero or more times
1516
--
@@ -22,7 +23,7 @@ import Control.Monad.Trans.Class
2223
-- try any more parsers for other constructors even if the parser for T1
2324
-- now fails in parsing the arguments of T1. Instead, we want to give the
2425
-- error message about attempting to parse T1.
25-
data Partial (f :: * -> *) (a :: *) =
26+
data Partial (f :: Type -> Type) (a :: Type) =
2627
Fail [String]
2728
| PZero a
2829
| PSucc (f (Partial f a))
@@ -36,7 +37,7 @@ instance Functor f => Functor (Partial f) where
3637
fmap f (PSucc pa) = PSucc (fmap (fmap f) pa)
3738

3839
instance Functor f => Monad (Partial f) where
39-
return = PZero
40+
return = pure
4041
#if !MIN_VERSION_base(4,13,0)
4142
fail = Fail . return
4243
#endif
@@ -66,7 +67,7 @@ instance MonadTrans Partial where
6667
lift ma = PSucc (PZero `liftM` ma)
6768

6869
instance Functor f => Applicative (Partial f) where
69-
pure = return
70+
pure = PZero
7071
f <*> a = do f' <- f ; a' <- a ; return (f' a')
7172

7273
instance (MonadPlus f, Functor f) => Alternative (Partial f) where

0 commit comments

Comments
 (0)