Skip to content

Commit ee3417d

Browse files
committed
Drop support for pre-8.0 versions of GHC
1 parent 2c40463 commit ee3417d

File tree

11 files changed

+65
-139
lines changed

11 files changed

+65
-139
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 39 additions & 76 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.16.6
11+
# version: 0.19.20240708
1212
#
13-
# REGENDATA ("0.16.6",["github","cabal.project"])
13+
# REGENDATA ("0.19.20240708",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,19 +23,29 @@ jobs:
2323
timeout-minutes:
2424
60
2525
container:
26-
image: buildpack-deps:bionic
26+
image: buildpack-deps:jammy
2727
continue-on-error: ${{ matrix.allow-failure }}
2828
strategy:
2929
matrix:
3030
include:
31-
- compiler: ghc-9.6.2
31+
- compiler: ghc-9.10.1
3232
compilerKind: ghc
33-
compilerVersion: 9.6.2
33+
compilerVersion: 9.10.1
3434
setup-method: ghcup
3535
allow-failure: false
36-
- compiler: ghc-9.4.5
36+
- compiler: ghc-9.8.2
3737
compilerKind: ghc
38-
compilerVersion: 9.4.5
38+
compilerVersion: 9.8.2
39+
setup-method: ghcup
40+
allow-failure: false
41+
- compiler: ghc-9.6.6
42+
compilerKind: ghc
43+
compilerVersion: 9.6.6
44+
setup-method: ghcup
45+
allow-failure: false
46+
- compiler: ghc-9.4.8
47+
compilerKind: ghc
48+
compilerVersion: 9.4.8
3949
setup-method: ghcup
4050
allow-failure: false
4151
- compiler: ghc-9.2.8
@@ -56,79 +66,39 @@ jobs:
5666
- compiler: ghc-8.8.4
5767
compilerKind: ghc
5868
compilerVersion: 8.8.4
59-
setup-method: hvr-ppa
69+
setup-method: ghcup
6070
allow-failure: false
6171
- compiler: ghc-8.6.5
6272
compilerKind: ghc
6373
compilerVersion: 8.6.5
64-
setup-method: hvr-ppa
74+
setup-method: ghcup
6575
allow-failure: false
6676
- compiler: ghc-8.4.4
6777
compilerKind: ghc
6878
compilerVersion: 8.4.4
69-
setup-method: hvr-ppa
79+
setup-method: ghcup
7080
allow-failure: false
7181
- compiler: ghc-8.2.2
7282
compilerKind: ghc
7383
compilerVersion: 8.2.2
74-
setup-method: hvr-ppa
84+
setup-method: ghcup
7585
allow-failure: false
7686
- compiler: ghc-8.0.2
7787
compilerKind: ghc
7888
compilerVersion: 8.0.2
79-
setup-method: hvr-ppa
80-
allow-failure: false
81-
- compiler: ghc-7.10.3
82-
compilerKind: ghc
83-
compilerVersion: 7.10.3
84-
setup-method: hvr-ppa
85-
allow-failure: false
86-
- compiler: ghc-7.8.4
87-
compilerKind: ghc
88-
compilerVersion: 7.8.4
89-
setup-method: hvr-ppa
90-
allow-failure: false
91-
- compiler: ghc-7.6.3
92-
compilerKind: ghc
93-
compilerVersion: 7.6.3
94-
setup-method: hvr-ppa
95-
allow-failure: false
96-
- compiler: ghc-7.4.2
97-
compilerKind: ghc
98-
compilerVersion: 7.4.2
99-
setup-method: hvr-ppa
100-
allow-failure: false
101-
- compiler: ghc-7.2.2
102-
compilerKind: ghc
103-
compilerVersion: 7.2.2
104-
setup-method: hvr-ppa
105-
allow-failure: false
106-
- compiler: ghc-7.0.4
107-
compilerKind: ghc
108-
compilerVersion: 7.0.4
109-
setup-method: hvr-ppa
89+
setup-method: ghcup
11090
allow-failure: false
11191
fail-fast: false
11292
steps:
11393
- name: apt
11494
run: |
11595
apt-get update
116-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
117-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
118-
mkdir -p "$HOME/.ghcup/bin"
119-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
120-
chmod a+x "$HOME/.ghcup/bin/ghcup"
121-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
122-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
123-
else
124-
apt-add-repository -y 'ppa:hvr/ghc'
125-
apt-get update
126-
apt-get install -y "$HCNAME"
127-
mkdir -p "$HOME/.ghcup/bin"
128-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
129-
chmod a+x "$HOME/.ghcup/bin/ghcup"
130-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
131-
fi
96+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
97+
mkdir -p "$HOME/.ghcup/bin"
98+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
99+
chmod a+x "$HOME/.ghcup/bin/ghcup"
100+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
101+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
132102
env:
133103
HCKIND: ${{ matrix.compilerKind }}
134104
HCNAME: ${{ matrix.compiler }}
@@ -140,20 +110,13 @@ jobs:
140110
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
141111
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
142112
HCDIR=/opt/$HCKIND/$HCVER
143-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
144-
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
145-
echo "HC=$HC" >> "$GITHUB_ENV"
146-
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
147-
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
148-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
149-
else
150-
HC=$HCDIR/bin/$HCKIND
151-
echo "HC=$HC" >> "$GITHUB_ENV"
152-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
153-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
154-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
155-
fi
156-
113+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
114+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
115+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
116+
echo "HC=$HC" >> "$GITHUB_ENV"
117+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
118+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
119+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
157120
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
158121
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
159122
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
@@ -210,7 +173,7 @@ jobs:
210173
chmod a+x $HOME/.cabal/bin/cabal-plan
211174
cabal-plan --version
212175
- name: checkout
213-
uses: actions/checkout@v3
176+
uses: actions/checkout@v4
214177
with:
215178
path: source
216179
- name: initial cabal.project for sdist
@@ -238,15 +201,15 @@ jobs:
238201
package data-reify
239202
flags: +tests
240203
EOF
241-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(data-reify)$/; }' >> cabal.project.local
204+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(data-reify)$/; }' >> cabal.project.local
242205
cat cabal.project
243206
cat cabal.project.local
244207
- name: dump install plan
245208
run: |
246209
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
247210
cabal-plan
248211
- name: restore cache
249-
uses: actions/cache/restore@v3
212+
uses: actions/cache/restore@v4
250213
with:
251214
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
252215
path: ~/.cabal/store
@@ -269,7 +232,7 @@ jobs:
269232
run: |
270233
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
271234
- name: save cache
272-
uses: actions/cache/save@v3
235+
uses: actions/cache/save@v4
273236
if: always()
274237
with:
275238
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## next [????.??.??]
2+
* Drop support for pre-8.0 versions of GHC.
3+
14
## 0.6.3 [2020.10.12]
25
* Fix a bug introduced in `data-reify-0.6.2` where `reifyGraph` could return
36
`Graph`s with duplicate key-value pairs.

Data/Reify.hs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE BangPatterns #-}
2-
{-# LANGUAGE CPP #-}
32
{-# LANGUAGE ExistentialQuantification #-}
43
{-# LANGUAGE RankNTypes #-}
54
{-# LANGUAGE TypeFamilies #-}
@@ -22,15 +21,6 @@ import Data.IntSet (IntSet)
2221

2322
import System.Mem.StableName
2423

25-
#if !(MIN_VERSION_base(4,7,0))
26-
import Unsafe.Coerce
27-
#endif
28-
29-
#if !(MIN_VERSION_base(4,8,0))
30-
import Control.Applicative
31-
import Data.Traversable
32-
#endif
33-
3424
-- | 'MuRef' is a class that provided a way to reference into a specific type,
3525
-- and a way to map over the deferenced internals.
3626
class MuRef a where
@@ -139,11 +129,7 @@ instance Hashable DynStableName where
139129

140130
instance Eq DynStableName where
141131
DynStableName m == DynStableName n =
142-
#if MIN_VERSION_base(4,7,0)
143132
eqStableName m n
144-
#else
145-
m == unsafeCoerce n
146-
#endif
147133

148134
makeDynStableName :: a -> IO DynStableName
149135
makeDynStableName a = do

data-reify.cabal

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,18 @@ Homepage: http://ku-fpg.github.io/software/data-reify/
2525
Stability: alpha
2626
build-type: Simple
2727
Cabal-Version: >= 1.10
28-
tested-with: GHC == 7.0.4
29-
, GHC == 7.2.2
30-
, GHC == 7.4.2
31-
, GHC == 7.6.3
32-
, GHC == 7.8.4
33-
, GHC == 7.10.3
34-
, GHC == 8.0.2
28+
tested-with: GHC == 8.0.2
3529
, GHC == 8.2.2
3630
, GHC == 8.4.4
3731
, GHC == 8.6.5
3832
, GHC == 8.8.4
3933
, GHC == 8.10.7
4034
, GHC == 9.0.2
4135
, GHC == 9.2.8
42-
, GHC == 9.4.5
43-
, GHC == 9.6.2
36+
, GHC == 9.4.8
37+
, GHC == 9.6.6
38+
, GHC == 9.8.2
39+
, GHC == 9.10.1
4440
extra-source-files: CHANGELOG.md, README.md
4541

4642
source-repository head
@@ -53,7 +49,10 @@ Flag tests
5349

5450

5551
Library
56-
Build-Depends: base >= 4 && < 5, hashable, containers, unordered-containers
52+
Build-Depends: base >= 4.9 && < 5
53+
, containers >= 0.5.7.1
54+
, hashable
55+
, unordered-containers
5756
Exposed-modules:
5857
Data.Reify,
5958
Data.Reify.Graph
@@ -66,8 +65,7 @@ test-suite spec
6665
type: exitcode-stdio-1.0
6766
main-is: Spec.hs
6867
other-modules: Data.ReifySpec
69-
build-depends: base >= 4 && < 5
70-
, base-compat >= 0.11 && < 0.15
68+
build-depends: base
7169
, data-reify
7270
, hspec == 2.*
7371
build-tool-depends: hspec-discover:hspec-discover == 2.*

examples/example1.hs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
{-# LANGUAGE CPP, TypeFamilies, DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
1+
{-# LANGUAGE TypeFamilies, DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
22

33
module Main (DistF,Dist,D,share,expand,main) where
44

55
import Data.Reify
66
import Data.IntMap as IntMap
77

8-
#if !(MIN_VERSION_base(4,8,0))
9-
import Control.Applicative
10-
import Data.Foldable
11-
import Data.Monoid
12-
import Data.Traversable
13-
#endif
14-
158
{-
169
This example was written by Edward Kmett for Johan Tibell,
1710
and can be found at http://lpaste.net/74064

examples/simplify.hs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,15 @@
1515
module Main (main) where
1616

1717
-- to define simplification
18-
#if MIN_VERSION_containers(0,5,0)
1918
import qualified Data.Map.Strict as Map
2019
import Data.Map.Strict (Map)
21-
#else
22-
import qualified Data.Map as Map
23-
import Data.Map (Map)
24-
#endif
2520
import Data.Reify (Graph(Graph), Unique)
2621
import qualified Data.Set as Set
2722

2823
-- for the example
2924
import Data.Reify (MuRef(mapDeRef), DeRef, reifyGraph)
3025

31-
#if !(MIN_VERSION_base(4,8,0))
32-
import Control.Applicative (Applicative(..))
33-
import Data.Foldable (Foldable,foldMap)
34-
import Data.Functor ((<$>))
35-
import Data.Monoid (Monoid(..))
36-
#endif
37-
38-
#if MIN_VERSION_base(4,9,0) && !(MIN_VERSION_base(4,11,0))
26+
#if !(MIN_VERSION_base(4,11,0))
3927
import Data.Semigroup (Semigroup(..))
4028
#endif
4129

@@ -70,10 +58,8 @@ newtype Hist a = Hist (Map a Int)
7058
count :: a -> Hist a
7159
count x = Hist (Map.singleton x 1)
7260

73-
#if __GLASGOW_HASKELL__ >= 800
7461
instance (Ord a) => Semigroup (Hist a) where
7562
(<>) (Hist m1) (Hist m2) = Hist (Map.unionWith (+) m1 m2)
76-
#endif
7763

7864
instance (Ord a) => Monoid (Hist a) where
7965
mempty = Hist Map.empty

spec/Data/ReifySpec.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{-# LANGUAGE StandaloneDeriving #-}
22
{-# LANGUAGE TypeFamilies #-}
33
{-# LANGUAGE UndecidableInstances #-}
4-
{-# OPTIONS_GHC -fno-warn-orphans #-}
4+
{-# OPTIONS_GHC -Wno-orphans #-}
55
module Data.ReifySpec where
66

77
import qualified Data.List as L
88
import Data.Reify
9-
import Prelude ()
10-
import Prelude.Compat
119
import Test.Hspec
1210

1311
main :: IO ()

test/Test4.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-# LANGUAGE TypeFamilies #-}
2-
{-# OPTIONS_GHC -fno-warn-orphans #-}
2+
{-# OPTIONS_GHC -Wno-orphans #-}
33
module Main (main) where
44

55
import Common

test/Test5.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-# LANGUAGE TypeFamilies #-}
2-
{-# OPTIONS_GHC -fno-warn-orphans #-}
2+
{-# OPTIONS_GHC -Wno-orphans #-}
33
module Main (main) where
44

55
import Common

test/Test6.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{-# LANGUAGE TypeFamilies, UndecidableInstances, DeriveDataTypeable,
1+
{-# LANGUAGE TypeFamilies, UndecidableInstances,
22
RankNTypes, ExistentialQuantification, TypeOperators #-}
3-
{-# OPTIONS_GHC -fno-warn-orphans #-}
3+
{-# OPTIONS_GHC -Wno-orphans #-}
44
module Main (main) where
55

66
import Common
@@ -32,7 +32,7 @@ instance NewVar Exp where
3232
-- return $ Var $ toDyn fn
3333

3434
data Exp = ExpVar Dynamic | ExpLit Int | ExpAdd Exp Exp
35-
deriving (Typeable, Show)
35+
deriving Show
3636

3737

3838
instance Eq Exp where

0 commit comments

Comments
 (0)