Skip to content

Commit 1d5606e

Browse files
authored
Merge pull request #16 from hesselink/noble
Support GHC-8.6.5--9.10.1
2 parents 50d3521 + 546b99f commit 1d5606e

File tree

5 files changed

+48
-393
lines changed

5 files changed

+48
-393
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 33 additions & 92 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.17.20231010
11+
# version: 0.19.20240513
1212
#
13-
# REGENDATA ("0.17.20231010",["github","cabal.project"])
13+
# REGENDATA ("0.19.20240513",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -27,24 +27,29 @@ jobs:
2727
timeout-minutes:
2828
60
2929
container:
30-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.8.1
35+
- compiler: ghc-9.10.1
3636
compilerKind: ghc
37-
compilerVersion: 9.8.1
37+
compilerVersion: 9.10.1
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.6.3
40+
- compiler: ghc-9.8.2
4141
compilerKind: ghc
42-
compilerVersion: 9.6.3
42+
compilerVersion: 9.8.2
4343
setup-method: ghcup
4444
allow-failure: false
45-
- compiler: ghc-9.4.7
45+
- compiler: ghc-9.6.5
4646
compilerKind: ghc
47-
compilerVersion: 9.4.7
47+
compilerVersion: 9.6.5
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.4.8
51+
compilerKind: ghc
52+
compilerVersion: 9.4.8
4853
setup-method: ghcup
4954
allow-failure: false
5055
- compiler: ghc-9.2.8
@@ -65,79 +70,24 @@ jobs:
6570
- compiler: ghc-8.8.4
6671
compilerKind: ghc
6772
compilerVersion: 8.8.4
68-
setup-method: hvr-ppa
73+
setup-method: ghcup
6974
allow-failure: false
7075
- compiler: ghc-8.6.5
7176
compilerKind: ghc
7277
compilerVersion: 8.6.5
73-
setup-method: hvr-ppa
74-
allow-failure: false
75-
- compiler: ghc-8.4.4
76-
compilerKind: ghc
77-
compilerVersion: 8.4.4
78-
setup-method: hvr-ppa
79-
allow-failure: false
80-
- compiler: ghc-8.2.2
81-
compilerKind: ghc
82-
compilerVersion: 8.2.2
83-
setup-method: hvr-ppa
84-
allow-failure: false
85-
- compiler: ghc-8.0.2
86-
compilerKind: ghc
87-
compilerVersion: 8.0.2
88-
setup-method: hvr-ppa
89-
allow-failure: false
90-
- compiler: ghc-7.10.3
91-
compilerKind: ghc
92-
compilerVersion: 7.10.3
93-
setup-method: hvr-ppa
94-
allow-failure: false
95-
- compiler: ghc-7.8.4
96-
compilerKind: ghc
97-
compilerVersion: 7.8.4
98-
setup-method: hvr-ppa
99-
allow-failure: false
100-
- compiler: ghc-7.6.3
101-
compilerKind: ghc
102-
compilerVersion: 7.6.3
103-
setup-method: hvr-ppa
104-
allow-failure: false
105-
- compiler: ghc-7.4.2
106-
compilerKind: ghc
107-
compilerVersion: 7.4.2
108-
setup-method: hvr-ppa
109-
allow-failure: false
110-
- compiler: ghc-7.2.2
111-
compilerKind: ghc
112-
compilerVersion: 7.2.2
113-
setup-method: hvr-ppa
114-
allow-failure: false
115-
- compiler: ghc-7.0.4
116-
compilerKind: ghc
117-
compilerVersion: 7.0.4
118-
setup-method: hvr-ppa
78+
setup-method: ghcup
11979
allow-failure: false
12080
fail-fast: false
12181
steps:
12282
- name: apt
12383
run: |
12484
apt-get update
12585
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
126-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
127-
mkdir -p "$HOME/.ghcup/bin"
128-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
129-
chmod a+x "$HOME/.ghcup/bin/ghcup"
130-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
131-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
132-
else
133-
apt-add-repository -y 'ppa:hvr/ghc'
134-
apt-get update
135-
apt-get install -y "$HCNAME"
136-
mkdir -p "$HOME/.ghcup/bin"
137-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
138-
chmod a+x "$HOME/.ghcup/bin/ghcup"
139-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
140-
fi
86+
mkdir -p "$HOME/.ghcup/bin"
87+
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
88+
chmod a+x "$HOME/.ghcup/bin/ghcup"
89+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
90+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
14191
env:
14292
HCKIND: ${{ matrix.compilerKind }}
14393
HCNAME: ${{ matrix.compiler }}
@@ -149,22 +99,13 @@ jobs:
14999
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
150100
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
151101
HCDIR=/opt/$HCKIND/$HCVER
152-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
153-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
154-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
155-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
156-
echo "HC=$HC" >> "$GITHUB_ENV"
157-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
158-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
159-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
160-
else
161-
HC=$HCDIR/bin/$HCKIND
162-
echo "HC=$HC" >> "$GITHUB_ENV"
163-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
164-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
165-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
166-
fi
167-
102+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
103+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
104+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
105+
echo "HC=$HC" >> "$GITHUB_ENV"
106+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
107+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
108+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
168109
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
169110
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
170111
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
@@ -221,7 +162,7 @@ jobs:
221162
chmod a+x $HOME/.cabal/bin/cabal-plan
222163
cabal-plan --version
223164
- name: checkout
224-
uses: actions/checkout@v3
165+
uses: actions/checkout@v4
225166
with:
226167
path: source
227168
- name: initial cabal.project for sdist
@@ -245,8 +186,8 @@ jobs:
245186
touch cabal.project
246187
touch cabal.project.local
247188
echo "packages: ${PKGDIR_type_equality}" >> cabal.project
248-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package type-equality" >> cabal.project ; fi
249-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
189+
echo "package type-equality" >> cabal.project
190+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
250191
cat >> cabal.project <<EOF
251192
EOF
252193
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(type-equality)$/; }' >> cabal.project.local
@@ -257,7 +198,7 @@ jobs:
257198
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
258199
cabal-plan
259200
- name: restore cache
260-
uses: actions/cache/restore@v3
201+
uses: actions/cache/restore@v4
261202
with:
262203
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
263204
path: ~/.cabal/store
@@ -284,7 +225,7 @@ jobs:
284225
rm -f cabal.project.local
285226
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
286227
- name: save cache
287-
uses: actions/cache/save@v3
228+
uses: actions/cache/save@v4
288229
if: always()
289230
with:
290231
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.1
2+
3+
* Support GHC-8.6.5..GHC-9.10.1
4+
15
## 1
26
* Rewrite the library to contain a shim of recent `base` `Data.Type.Equality` module.
37

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,7 @@
1-
{-# LANGUAGE CPP #-}
2-
#if __GLASGOW_HASKELL__ <800
3-
#error "Trying to compiled Data.Type.Equality.Hetero module with GHC <8.0"
4-
#endif
5-
{-# LANGUAGE DeriveDataTypeable #-}
6-
{-# LANGUAGE GADTs #-}
7-
{-# LANGUAGE KindSignatures #-}
8-
{-# LANGUAGE PolyKinds #-}
9-
{-# LANGUAGE StandaloneDeriving #-}
10-
{-# LANGUAGE Trustworthy #-}
11-
{-# LANGUAGE TypeInType #-}
121
{-# LANGUAGE TypeOperators #-}
132
-- | This module shims kind heterogeneous propositional equality.
14-
--
15-
-- Note: some instances: 'Read', 'Enum', 'Bounded' and 'Data' would be available
16-
-- only since GHC-8.0 as we need @~~@ constraint.
17-
-- Also GH-7.10.3 is nitpicky /data constructor ‘HRefl’ cannot be GADT-like in its *kind* arguments/,
18-
-- thus this module is available only with GHC >= 8.0
193
module Data.Type.Equality.Hetero (
204
(:~~:)(..),
21-
) where
5+
) where
226

23-
#if MIN_VERSION_base(4,10,0)
247
import Data.Type.Equality ((:~~:)(..))
25-
#else
26-
27-
import qualified Control.Category as C
28-
import Data.Data (Data)
29-
import Data.Type.Equality
30-
import Data.Typeable (Typeable)
31-
32-
#if MIN_VERSION_base(4,7,0)
33-
import Data.Type.Coercion (TestCoercion (..), Coercion (..))
34-
#endif
35-
36-
-- | Kind heterogeneous propositional equality. Like ':~:', @a :~~: b@ is
37-
-- inhabited by a terminating value if and only if @a@ is the same type as @b@.
38-
data (a :: k1) :~~: (b :: k2) where
39-
HRefl :: a :~~: a
40-
41-
infixr 4 :~~:
42-
43-
deriving instance Eq (a :~~: b)
44-
deriving instance Show (a :~~: b)
45-
deriving instance Ord (a :~~: b)
46-
47-
deriving instance a ~~ b => Read (a :~~: b)
48-
49-
instance a ~~ b => Enum (a :~~: b) where
50-
toEnum 0 = HRefl
51-
toEnum _ = errorWithoutStackTrace "Data.Type.Equality.Hetero.toEnum: bad argument"
52-
53-
fromEnum HRefl = 0
54-
55-
deriving instance a ~~ b => Bounded (a :~~: b)
56-
57-
deriving instance Typeable (:~~:)
58-
deriving instance (Typeable i, Typeable j, Typeable a, Typeable b,
59-
(a :: i) ~~ (b :: j)) => Data (a :~~: b)
60-
61-
instance C.Category (:~~:) where
62-
id = HRefl
63-
HRefl . HRefl = HRefl
64-
65-
instance TestEquality ((:~~:) a) where
66-
testEquality HRefl HRefl = Just Refl
67-
68-
instance TestCoercion ((:~~:) a) where
69-
testCoercion HRefl HRefl = Just Coercion
70-
#endif

0 commit comments

Comments
 (0)