Skip to content

Commit 823be58

Browse files
authored
Drop support of GHC 8.0 and base-4.9 (#954)
1 parent 48196fb commit 823be58

File tree

11 files changed

+29
-70
lines changed

11 files changed

+29
-70
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 23 additions & 28 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.15.20230128
11+
# version: 0.16.5
1212
#
13-
# REGENDATA ("0.15.20230128",["github","--config=cabal.haskell-ci","--ghc-head","cabal.project"])
13+
# REGENDATA ("0.16.5",["github","--config=cabal.haskell-ci","--ghc-head","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -32,19 +32,19 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.6.0.20230111
35+
- compiler: ghc-9.6.2
3636
compilerKind: ghc
37-
compilerVersion: 9.6.0.20230111
37+
compilerVersion: 9.6.2
3838
setup-method: ghcup
39-
allow-failure: true
40-
- compiler: ghc-9.4.2
39+
allow-failure: false
40+
- compiler: ghc-9.4.5
4141
compilerKind: ghc
42-
compilerVersion: 9.4.2
42+
compilerVersion: 9.4.5
4343
setup-method: ghcup
4444
allow-failure: false
45-
- compiler: ghc-9.2.2
45+
- compiler: ghc-9.2.8
4646
compilerKind: ghc
47-
compilerVersion: 9.2.2
47+
compilerVersion: 9.2.8
4848
setup-method: ghcup
4949
allow-failure: false
5050
- compiler: ghc-9.0.2
@@ -77,11 +77,6 @@ jobs:
7777
compilerVersion: 8.2.2
7878
setup-method: hvr-ppa
7979
allow-failure: false
80-
- compiler: ghc-8.0.2
81-
compilerKind: ghc
82-
compilerVersion: 8.0.2
83-
setup-method: hvr-ppa
84-
allow-failure: false
8580
fail-fast: false
8681
steps:
8782
- name: apt
@@ -90,20 +85,20 @@ jobs:
9085
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
9186
if [ "${{ matrix.setup-method }}" = ghcup ]; then
9287
mkdir -p "$HOME/.ghcup/bin"
93-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
88+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
9489
chmod a+x "$HOME/.ghcup/bin/ghcup"
9590
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
9691
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
97-
"$HOME/.ghcup/bin/ghcup" install cabal 3.9.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
92+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
9893
else
9994
apt-add-repository -y 'ppa:hvr/ghc'
10095
apt-get update
10196
apt-get install -y "$HCNAME"
10297
mkdir -p "$HOME/.ghcup/bin"
103-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
98+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
10499
chmod a+x "$HOME/.ghcup/bin/ghcup"
105100
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
106-
"$HOME/.ghcup/bin/ghcup" install cabal 3.9.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
101+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
107102
fi
108103
env:
109104
HCKIND: ${{ matrix.compilerKind }}
@@ -121,20 +116,20 @@ jobs:
121116
echo "HC=$HC" >> "$GITHUB_ENV"
122117
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
123118
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
124-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.9.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
119+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
125120
else
126121
HC=$HCDIR/bin/$HCKIND
127122
echo "HC=$HC" >> "$GITHUB_ENV"
128123
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
129124
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
130-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.9.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
125+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
131126
fi
132127
133128
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
134129
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
135130
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
136131
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
137-
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
132+
if [ $((HCNUMVER > 90602)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
138133
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
139134
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
140135
env:
@@ -191,8 +186,8 @@ jobs:
191186
- name: install cabal-plan
192187
run: |
193188
mkdir -p $HOME/.cabal/bin
194-
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
195-
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
189+
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
190+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
196191
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
197192
rm -f cabal-plan.xz
198193
chmod a+x $HOME/.cabal/bin/cabal-plan
@@ -226,10 +221,10 @@ jobs:
226221
touch cabal.project.local
227222
echo "packages: ${PKGDIR_containers}" >> cabal.project
228223
echo "packages: ${PKGDIR_containers_tests}" >> cabal.project
229-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package containers" >> cabal.project ; fi
230-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
231-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package containers-tests" >> cabal.project ; fi
232-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
224+
echo "package containers" >> cabal.project
225+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
226+
echo "package containers-tests" >> cabal.project
227+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
233228
cat >> cabal.project <<EOF
234229
EOF
235230
if $HEADHACKAGE; then
@@ -259,7 +254,7 @@ jobs:
259254
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
260255
- name: haddock
261256
run: |
262-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
257+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
263258
- name: unconstrained build
264259
run: |
265260
rm -f cabal.project.local

cabal.haskell-ci

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ install-dependencies: False
1313
-- depends on containers
1414
installed: +all -binary -text -ghc-heap
1515

16-
haddock: >= 8.2
17-
1816
cabal-check: False

containers-tests/containers-tests.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ extra-source-files:
2626
benchmarks/LookupGE/*.hs
2727

2828
tested-with:
29-
GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.2 ||
30-
==9.4.2 || ==9.6.1
29+
GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 ||
30+
==9.4.5 || ==9.6.2
3131

3232
source-repository head
3333
type: git
@@ -36,7 +36,7 @@ source-repository head
3636
common deps
3737
build-depends:
3838
array >=0.4.0.0
39-
, base >=4.9.1 && <5
39+
, base >=4.10 && <5
4040
, deepseq >=1.2 && <1.5
4141
, template-haskell
4242

containers-tests/tests/map-properties.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ import Data.Ord
2222
import Data.Semigroup (Arg(..))
2323
import Data.Function
2424
import qualified Data.Foldable as Foldable
25-
#if MIN_VERSION_base(4,10,0)
2625
import qualified Data.Bifoldable as Bifoldable
27-
#endif
2826
import Prelude hiding (lookup, null, map, filter, foldr, foldl, take, drop, splitAt)
2927
import qualified Prelude
3028

@@ -233,14 +231,12 @@ main = defaultMain $ testGroup "map-properties"
233231
, testProperty "foldlWithKey" prop_foldlWithKey
234232
, testProperty "foldl'" prop_foldl'
235233
, testProperty "foldlWithKey'" prop_foldlWithKey'
236-
#if MIN_VERSION_base(4,10,0)
237234
, testProperty "bifold" prop_bifold
238235
, testProperty "bifoldMap" prop_bifoldMap
239236
, testProperty "bifoldr" prop_bifoldr
240237
, testProperty "bifoldr'" prop_bifoldr'
241238
, testProperty "bifoldl" prop_bifoldl
242239
, testProperty "bifoldl'" prop_bifoldl'
243-
#endif
244240
, testProperty "keysSet" prop_keysSet
245241
, testProperty "argSet" prop_argSet
246242
, testProperty "fromSet" prop_fromSet
@@ -1541,7 +1537,6 @@ prop_foldlWithKey' c n m = foldlWithKey' c' n m === Foldable.foldl' (uncurry . c
15411537
where
15421538
c' acc k v = apply c (acc, k, v)
15431539

1544-
#if MIN_VERSION_base(4,10,0)
15451540
prop_bifold :: Map Int Int -> Property
15461541
prop_bifold m = Bifoldable.bifold (mapKeys (:[]) ((:[]) <$> m)) === Foldable.fold ((\(k,v) -> [k,v]) <$> toList m)
15471542

@@ -1575,7 +1570,6 @@ prop_bifoldl' ck cv n m = Bifoldable.bifoldl' ck' cv' n m === Foldable.foldl' c'
15751570
ck' = curry (apply ck)
15761571
cv' = curry (apply cv)
15771572
acc `c'` (k,v) = (acc `ck'` k) `cv'` v
1578-
#endif
15791573

15801574
prop_keysSet :: [(Int, Int)] -> Bool
15811575
prop_keysSet xs =

containers/containers.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ extra-source-files:
2626
changelog.md
2727
mkappend.hs
2828

29-
tested-with: GHC==9.6.1, GHC==9.4.2, GHC==9.2.2, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2
29+
tested-with: GHC==9.6.2, GHC==9.4.5, GHC==9.2.8, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2
3030

3131
source-repository head
3232
type: git
3333
location: http://github.com/haskell/containers.git
3434

3535
Library
3636
default-language: Haskell2010
37-
build-depends: base >= 4.9.1 && < 5, array >= 0.4.0.0, deepseq >= 1.2 && < 1.5, template-haskell
37+
build-depends: base >= 4.10 && < 5, array >= 0.4.0.0, deepseq >= 1.2 && < 1.5, template-haskell
3838
hs-source-dirs: src
3939
ghc-options: -O2 -Wall -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates
4040

containers/src/Data/Graph.hs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
{-# LANGUAGE DeriveGeneric #-}
77
{-# LANGUAGE DeriveLift #-}
88
{-# LANGUAGE StandaloneDeriving #-}
9-
# if __GLASGOW_HASKELL__ >= 802
109
{-# LANGUAGE Safe #-}
11-
# else
12-
{-# LANGUAGE Trustworthy #-}
13-
# endif
1410
#endif
1511

1612
#include "containers.h"
@@ -147,14 +143,10 @@ data SCC vertex = AcyclicSCC vertex -- ^ A single vertex that is not
147143
-- in any cycle.
148144
| CyclicSCC [vertex] -- ^ A maximal set of mutually
149145
-- reachable vertices.
150-
#if __GLASGOW_HASKELL__ >= 802
151146
deriving ( Eq -- ^ @since 0.5.9
152147
, Show -- ^ @since 0.5.9
153148
, Read -- ^ @since 0.5.9
154149
)
155-
#else
156-
deriving (Eq, Show, Read)
157-
#endif
158150

159151
#ifdef __GLASGOW_HASKELL__
160152
-- | @since 0.5.9

containers/src/Data/Map/Internal.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,7 @@ import Control.Applicative (Const (..))
387387
import Control.DeepSeq (NFData(rnf))
388388
import Data.Bits (shiftL, shiftR)
389389
import qualified Data.Foldable as Foldable
390-
#if MIN_VERSION_base(4,10,0)
391390
import Data.Bifoldable
392-
#endif
393391
import Utils.Containers.Internal.Prelude hiding
394392
(lookup, map, filter, foldr, foldl, foldl', null, splitAt, take, drop)
395393
import Prelude ()
@@ -4283,7 +4281,6 @@ instance Foldable.Foldable (Map k) where
42834281
product = foldl' (*) 1
42844282
{-# INLINABLE product #-}
42854283

4286-
#if MIN_VERSION_base(4,10,0)
42874284
-- | @since 0.6.3.1
42884285
instance Bifoldable Map where
42894286
bifold = go
@@ -4304,7 +4301,6 @@ instance Bifoldable Map where
43044301
go (Bin 1 k v _ _) = f k `mappend` g v
43054302
go (Bin _ k v l r) = go l `mappend` (f k `mappend` (g v `mappend` go r))
43064303
{-# INLINE bifoldMap #-}
4307-
#endif
43084304

43094305
instance (NFData k, NFData a) => NFData (Map k a) where
43104306
rnf Tip = ()

containers/src/Data/Sequence/Internal.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,8 @@ infixl 5 |>, :>
275275
infixr 5 :<|
276276
infixl 5 :|>
277277

278-
#if __GLASGOW_HASKELL__ >= 801
279278
{-# COMPLETE (:<|), Empty #-}
280279
{-# COMPLETE (:|>), Empty #-}
281-
#endif
282280

283281
-- | A bidirectional pattern synonym matching an empty sequence.
284282
--
@@ -529,9 +527,7 @@ instance Applicative Seq where
529527
pure = singleton
530528
xs *> ys = cycleNTimes (length xs) ys
531529
(<*>) = apSeq
532-
#if MIN_VERSION_base(4,10,0)
533530
liftA2 = liftA2Seq
534-
#endif
535531
xs <* ys = beforeSeq xs ys
536532

537533
apSeq :: Seq (a -> b) -> Seq a -> Seq b

containers/src/Data/Tree.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,8 @@ instance Applicative Tree where
162162
pure x = Node x []
163163
Node f tfs <*> tx@(Node x txs) =
164164
Node (f x) (map (f <$>) txs ++ map (<*> tx) tfs)
165-
#if MIN_VERSION_base(4,10,0)
166165
liftA2 f (Node x txs) ty@(Node y tys) =
167166
Node (f x y) (map (f x <$>) tys ++ map (\tx -> liftA2 f tx ty) txs)
168-
#endif
169167
Node x txs <* ty@(Node _ tys) =
170168
Node x (map (x <$) tys ++ map (<* ty) txs)
171169
Node _ txs *> ty@(Node y tys) =
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
{-# LANGUAGE CPP #-}
21
-- | This hideous module lets us avoid dealing with the fact that
3-
-- @liftA2@ wasn't previously exported from the standard prelude.
2+
-- @liftA2@ and @foldl'@ were not previously exported from the standard prelude.
43
module Utils.Containers.Internal.Prelude
54
( module Prelude
65
, Applicative (..)
76
, Foldable (..)
8-
#if !MIN_VERSION_base(4,10,0)
9-
, liftA2
10-
#endif
117
)
128
where
139

1410
import Prelude hiding (Applicative(..), Foldable(..))
1511
import Control.Applicative(Applicative(..))
1612
import Data.Foldable (Foldable(elem, foldMap, foldr, foldl, foldl', foldr1, foldl1, maximum, minimum, product, sum, null, length))
17-
18-
#if !MIN_VERSION_base(4,10,0)
19-
import Control.Applicative(liftA2)
20-
#endif

0 commit comments

Comments
 (0)