Skip to content

Commit 4260319

Browse files
committed
Add support for GHC 8.10
1 parent 310d83b commit 4260319

File tree

5 files changed

+66
-25
lines changed

5 files changed

+66
-25
lines changed

.travis.yml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,44 @@ before_cache:
3737
matrix:
3838
include:
3939
- compiler: "ghc-8.0.2"
40-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
40+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
4141
- compiler: "ghc-8.2.2"
42-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
42+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
4343
- compiler: "ghc-8.4.4"
44-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.4], sources: [hvr-ghc]}}
45-
- compiler: "ghc-8.6.4"
46-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.6.4], sources: [hvr-ghc]}}
47-
- compiler: "ghc-head"
48-
env: GHCHEAD=true
49-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}
44+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
45+
- compiler: "ghc-8.6.5"
46+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.5], sources: [hvr-ghc]}}
47+
- compiler: "ghc-8.8.1"
48+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-3.0,ghc-8.8.1], sources: [hvr-ghc]}}
49+
- compiler: "ghc-8.10.1"
50+
env: HEADHACKAGE=true
51+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-3.0,ghc-8.10.1], sources: [hvr-ghc]}}
52+
- env:
53+
- GHCHEAD=true
54+
- HEADHACKAGE=true
55+
- GHC_ZIP='https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/download?job=validate-x86_64-linux-deb9-hadrian'
56+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head], sources: [hvr-ghc]}}
5057

5158
allow_failures:
52-
- compiler: "ghc-head"
59+
- env:
60+
- GHCHEAD=true
61+
- HEADHACKAGE=true
62+
- GHC_ZIP='https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/download?job=validate-x86_64-linux-deb9-hadrian'
5363

5464
before_install:
65+
- GHCHEAD=${GHCHEAD-false}
66+
- |
67+
if $GHCHEAD; then
68+
travis_retry curl -L $GHC_ZIP --output artifact.zip
69+
unzip artifact.zip
70+
tar xpf ghc.tar.xz --strip-components 1
71+
mkdir -p $HOME/ghc-head
72+
sed -i -e 's/lld/gold/g' lib/settings
73+
./configure --prefix=$HOME/ghc-head
74+
make V=1 install
75+
PATH=$HOME/ghc-head/bin:$PATH
76+
CC=ghc
77+
fi
5578
- HC=${CC}
5679
- HCPKG=${HC/ghc/ghc-pkg}
5780
- unset CC
@@ -69,12 +92,13 @@ install:
6992
- HADDOCK=${HADDOCK-true}
7093
- INSTALLED=${INSTALLED-true}
7194
- GHCHEAD=${GHCHEAD-false}
95+
- HEADHACKAGE=${HEADHACKAGE-false}
7296
- travis_retry cabal update -v
7397
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
7498
- rm -fv cabal.project cabal.project.local
7599
# Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
76100
- |
77-
if $GHCHEAD; then
101+
if $HEADHACKAGE; then
78102
sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config
79103
80104
echo 'repository head.hackage' >> ${HOME}/.cabal/config
@@ -103,7 +127,7 @@ install:
103127
# any command which exits with a non-zero exit code causes the build to fail.
104128
script:
105129
# test that source-distributions can be generated
106-
- (cd "." && cabal sdist)
130+
- (cd "." && cabal new-sdist)
107131
- mv "."/dist-newstyle/sdist/ghc-typelits-extra-*.tar.gz ${DISTDIR}/
108132
- cd ${DISTDIR} || false
109133
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog for the [`ghc-typelits-extra`](http://hackage.haskell.org/package/ghc-typelits-extra) package
22

3+
# 0.3.3 *February 6th 2020*
4+
* Add support for GHC 8.10.1-alpha2
5+
36
# 0.3.2 *January 18th 2020*
47
* Fix https://github.com/clash-lang/clash-compiler/issues/1019
58

ghc-typelits-extra.cabal

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: ghc-typelits-extra
2-
version: 0.3.2
2+
version: 0.3.3
33
synopsis: Additional type-level operations on GHC.TypeLits.Nat
44
description:
55
Additional type-level operations on @GHC.TypeLits.Nat@:
@@ -47,7 +47,9 @@ build-type: Simple
4747
extra-source-files: README.md
4848
CHANGELOG.md
4949
cabal-version: >=1.10
50-
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.4
50+
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5,
51+
GHC == 8.8.1, GHC == 8.10.1
52+
5153

5254
source-repository head
5355
type: git
@@ -66,11 +68,11 @@ library
6668
GHC.TypeLits.Extra.Solver.Operations
6769
build-depends: base >= 4.8 && <5,
6870
containers >= 0.5.7.1 && <0.7,
69-
ghc >= 7.10 && <8.9,
71+
ghc >= 7.10 && <8.11,
7072
ghc-prim >= 0.5 && <1.0,
71-
ghc-tcplugins-extra >= 0.2,
72-
ghc-typelits-knownnat >= 0.6 && <0.8,
73-
ghc-typelits-natnormalise >= 0.6 && <0.8,
73+
ghc-tcplugins-extra >= 0.3.1,
74+
ghc-typelits-knownnat >= 0.7.2 && <0.8,
75+
ghc-typelits-natnormalise >= 0.7.1 && <0.8,
7476
integer-gmp >= 1.0 && <1.1,
7577
transformers >= 0.4.2.0 && <0.6
7678
hs-source-dirs: src
@@ -98,8 +100,8 @@ test-suite test-ghc-typelits-extra
98100
Other-Modules: ErrorTests
99101
build-depends: base >= 4.8 && <5,
100102
ghc-typelits-extra,
101-
ghc-typelits-knownnat >= 0.6,
102-
ghc-typelits-natnormalise >= 0.4.1,
103+
ghc-typelits-knownnat >= 0.7.2,
104+
ghc-typelits-natnormalise >= 0.7.1,
103105
tasty >= 0.10,
104106
tasty-hunit >= 0.9
105107
hs-source-dirs: tests

src/GHC/TypeLits/Extra/Solver.hs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ import Plugins (purePlugin)
4040
#endif
4141
import TcEvidence (EvTerm)
4242
import TcPluginM (TcPluginM, tcLookupTyCon, tcPluginTrace)
43-
import TcRnTypes (Ct, TcPlugin(..), TcPluginResult (..), ctEvidence, ctEvPred,
44-
isWantedCt)
45-
import TcType (typeKind)
46-
import Type (EqRel (NomEq), Kind, PredTree (EqPred), classifyPredType,
47-
eqType)
43+
import TcRnTypes (TcPlugin(..), TcPluginResult (..))
44+
import Type (Kind, eqType)
4845
import TyCoRep (Type (..))
4946
import TysWiredIn (typeNatKind, promotedTrueDataCon, promotedFalseDataCon)
5047
import TcTypeNats (typeNatLeqTyCon)
@@ -56,6 +53,16 @@ import TcPluginM (zonkCt)
5653
import Control.Monad ((<=<))
5754
#endif
5855

56+
#if MIN_VERSION_ghc(8,10,0)
57+
import Constraint (Ct, ctEvidence, ctEvPred, isWantedCt)
58+
import Predicate (EqRel (NomEq), Pred (EqPred), classifyPredType)
59+
import Type (typeKind)
60+
#else
61+
import TcRnTypes (Ct, ctEvidence, ctEvPred, isWantedCt)
62+
import TcType (typeKind)
63+
import Type (EqRel (NomEq), PredTree (EqPred), classifyPredType)
64+
#endif
65+
5966
-- internal
6067
import GHC.TypeLits.Extra.Solver.Operations
6168
import GHC.TypeLits.Extra.Solver.Unify

src/GHC/TypeLits/Extra/Solver/Unify.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ import qualified GHC.TypeLits.Normalise.Unify as Normalise
2626
-- GHC API
2727
import Outputable (Outputable (..), ($$), text)
2828
import TcPluginM (TcPluginM, matchFam, tcPluginTrace)
29-
import TcRnMonad (Ct)
3029
import TcTypeNats (typeNatExpTyCon)
3130
import Type (TyVar, coreView)
3231
import TyCoRep (Type (..), TyLit (..))
3332
import UniqSet (UniqSet, emptyUniqSet, unionUniqSets, unitUniqSet)
3433

34+
#if MIN_VERSION_ghc(8,10,0)
35+
import Constraint (Ct)
36+
#else
37+
import TcRnMonad (Ct)
38+
#endif
39+
3540
-- internal
3641
import GHC.TypeLits.Extra.Solver.Operations
3742

0 commit comments

Comments
 (0)