Skip to content

Commit 83d04b0

Browse files
authored
Merge pull request #48 from haskellari/squash
Squash of stuff
2 parents 6efbd3b + bf68f14 commit 83d04b0

File tree

10 files changed

+242
-25
lines changed

10 files changed

+242
-25
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 52 additions & 12 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.13.20211030
11+
# version: 0.15.20220609
1212
#
13-
# REGENDATA ("0.13.20211030",["github","cabal.project"])
13+
# REGENDATA ("0.15.20220609",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,16 +23,23 @@ on:
2323
jobs:
2424
linux:
2525
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-18.04
26+
runs-on: ubuntu-20.04
27+
timeout-minutes:
28+
60
2729
container:
2830
image: buildpack-deps:bionic
2931
continue-on-error: ${{ matrix.allow-failure }}
3032
strategy:
3133
matrix:
3234
include:
33-
- compiler: ghc-9.2.1
35+
- compiler: ghc-9.4.0.20220523
3436
compilerKind: ghc
35-
compilerVersion: 9.2.1
37+
compilerVersion: 9.4.0.20220523
38+
setup-method: ghcup
39+
allow-failure: true
40+
- compiler: ghc-9.2.3
41+
compilerKind: ghc
42+
compilerVersion: 9.2.3
3643
setup-method: ghcup
3744
allow-failure: false
3845
- compiler: ghc-9.0.1
@@ -108,18 +115,19 @@ jobs:
108115
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
109116
if [ "${{ matrix.setup-method }}" = ghcup ]; then
110117
mkdir -p "$HOME/.ghcup/bin"
111-
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
118+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.8/x86_64-linux-ghcup-0.1.17.8 > "$HOME/.ghcup/bin/ghcup"
112119
chmod a+x "$HOME/.ghcup/bin/ghcup"
113-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
114-
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
120+
if $HEADHACKAGE; then "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; fi
121+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
122+
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
115123
else
116124
apt-add-repository -y 'ppa:hvr/ghc'
117125
apt-get update
118126
apt-get install -y "$HCNAME"
119127
mkdir -p "$HOME/.ghcup/bin"
120-
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
128+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.8/x86_64-linux-ghcup-0.1.17.8 > "$HOME/.ghcup/bin/ghcup"
121129
chmod a+x "$HOME/.ghcup/bin/ghcup"
122-
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
130+
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
123131
fi
124132
env:
125133
HCKIND: ${{ matrix.compilerKind }}
@@ -150,7 +158,7 @@ jobs:
150158
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
151159
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
152160
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
153-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
161+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
154162
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
155163
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
156164
env:
@@ -179,6 +187,22 @@ jobs:
179187
repository hackage.haskell.org
180188
url: http://hackage.haskell.org/
181189
EOF
190+
if $HEADHACKAGE; then
191+
cat >> $CABAL_CONFIG <<EOF
192+
repository head.hackage.ghc.haskell.org
193+
url: https://ghc.gitlab.haskell.org/head.hackage/
194+
secure: True
195+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
196+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
197+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
198+
key-threshold: 3
199+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
200+
EOF
201+
fi
202+
cat >> $CABAL_CONFIG <<EOF
203+
program-default-options
204+
ghc-options: $GHCJOBS +RTS -M3G -RTS
205+
EOF
182206
cat $CABAL_CONFIG
183207
- name: versions
184208
run: |
@@ -197,6 +221,15 @@ jobs:
197221
rm -f cabal-plan.xz
198222
chmod a+x $HOME/.cabal/bin/cabal-plan
199223
cabal-plan --version
224+
- name: install cabal-docspec
225+
run: |
226+
mkdir -p $HOME/.cabal/bin
227+
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20211114/cabal-docspec-0.0.0.20211114.xz > cabal-docspec.xz
228+
echo 'e224700d9e8c9ec7ec6bc3f542ba433cd9925a5d356676c62a9bd1f2c8be8f8a cabal-docspec.xz' | sha256sum -c -
229+
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
230+
rm -f cabal-docspec.xz
231+
chmod a+x $HOME/.cabal/bin/cabal-docspec
232+
cabal-docspec --version
200233
- name: checkout
201234
uses: actions/checkout@v2
202235
with:
@@ -226,6 +259,9 @@ jobs:
226259
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
227260
cat >> cabal.project <<EOF
228261
EOF
262+
if $HEADHACKAGE; then
263+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
264+
fi
229265
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(some)$/; }' >> cabal.project.local
230266
cat cabal.project
231267
cat cabal.project.local
@@ -252,13 +288,17 @@ jobs:
252288
- name: tests
253289
run: |
254290
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
291+
- name: docspec
292+
run: |
293+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all ; fi
294+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then cabal-docspec $ARG_COMPILER ; fi
255295
- name: cabal check
256296
run: |
257297
cd ${PKGDIR_some} || false
258298
${CABAL} -vnormal check
259299
- name: haddock
260300
run: |
261-
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
301+
$CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
262302
- name: unconstrained build
263303
run: |
264304
rm -f cabal.project.local

ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 1.0.4
2+
3+
- Add instances for `(:~~:)`
4+
- Add instances for `:+:` and `:*:`
5+
- Add `defaultGeq :: GCompare f => f a -> f b -> Maybe (a :~: b)`
6+
- Add `defaultGshowsPrec :: Show (t a) => Int -> t a -> ShowS`
7+
18
# 1.0.3
29

310
- Make `GNFData` PolyKinded.

cabal.haskell-ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
branches : master
2+
docspec: >=8.2
23

34
constraint-set safe
45
constraints: some -newtype-unsafe

some.cabal

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: some
2-
version: 1.0.3
3-
x-revision: 2
4-
stability: provisional
2+
version: 1.0.4
53
cabal-version: >=1.10
64
build-type: Simple
75
author:
@@ -39,7 +37,8 @@ tested-with:
3937
|| ==8.8.4
4038
|| ==8.10.4
4139
|| ==9.0.1
42-
|| ==9.2.1
40+
|| ==9.2.3
41+
|| ==9.4.1
4342

4443
extra-source-files: ChangeLog.md
4544

@@ -77,7 +76,7 @@ library
7776
base >=4.3 && <4.17
7877
, deepseq >=1.3.0.0 && <1.5
7978

80-
if !impl(ghc >=7.8)
79+
if !impl(ghc >=8.2)
8180
build-depends: type-equality >=1 && <1.1
8281

8382
if !impl(ghc >=8.0)

src/Data/GADT/Compare.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
module Data.GADT.Compare (
88
-- * Equality
99
GEq (..),
10+
defaultGeq,
1011
defaultEq,
1112
defaultNeq,
1213
-- * Total order comparison

src/Data/GADT/DeepSeq.hs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE GADTs #-}
3+
{-# LANGUAGE TypeOperators #-}
34
#if __GLASGOW_HASKELL__ >= 706
45
{-# LANGUAGE PolyKinds #-}
56
#endif
@@ -19,6 +20,18 @@ import Data.Functor.Product (Product (..))
1920
import Data.Functor.Sum (Sum (..))
2021
import Data.Type.Equality ((:~:) (..))
2122

23+
#if MIN_VERSION_base(4,6,0)
24+
import GHC.Generics ((:+:) (..), (:*:) (..))
25+
#endif
26+
27+
#if MIN_VERSION_base(4,9,0)
28+
#if MIN_VERSION_base(4,10,0)
29+
import Data.Type.Equality ((:~~:) (..))
30+
#else
31+
import Data.Type.Equality.Hetero ((:~~:) (..))
32+
#endif
33+
#endif
34+
2235
#if MIN_VERSION_base(4,10,0)
2336
import qualified Type.Reflection as TR
2437
#endif
@@ -41,10 +54,25 @@ instance (GNFData a, GNFData b) => GNFData (Sum a b) where
4154
grnf (InL x) = grnf x
4255
grnf (InR y) = grnf y
4356

57+
#if MIN_VERSION_base(4,6,0)
58+
instance (GNFData a, GNFData b) => GNFData (a :*: b) where
59+
grnf (a :*: b) = grnf a `seq` grnf b
60+
61+
instance (GNFData a, GNFData b) => GNFData (a :+: b) where
62+
grnf (L1 x) = grnf x
63+
grnf (R1 y) = grnf y
64+
#endif
65+
4466
-- | @since 1.0.3
4567
instance GNFData ((:~:) a) where
4668
grnf Refl = ()
4769

70+
#if MIN_VERSION_base(4,9,0)
71+
-- | @since 1.0.4
72+
instance GNFData ((:~~:) a) where
73+
grnf HRefl = ()
74+
#endif
75+
4876
#if MIN_VERSION_base(4,10,0)
4977
-- | @since 1.0.3
5078
instance GNFData TR.TypeRep where

0 commit comments

Comments
 (0)