Skip to content

Commit

Permalink
Drop support of GHC < 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Sep 9, 2023
1 parent 0239408 commit 4115223
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 115 deletions.
83 changes: 42 additions & 41 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.15.20230115
# version: 0.17.20230826
#
# REGENDATA ("0.15.20230115",["github","data-interval.cabal","--output",".github/workflows/build.yaml"])
# REGENDATA ("0.17.20230826",["github","data-interval.cabal","--output",".github/workflows/build.yaml"])
#
name: Haskell-CI
on:
Expand All @@ -28,19 +28,24 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.6.0.20230111
- compiler: ghc-9.8.0.20230822
compilerKind: ghc
compilerVersion: 9.6.0.20230111
compilerVersion: 9.8.0.20230822
setup-method: ghcup
allow-failure: true
- compiler: ghc-9.4.4
- compiler: ghc-9.6.2
compilerKind: ghc
compilerVersion: 9.4.4
compilerVersion: 9.6.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.5
- compiler: ghc-9.4.7
compilerKind: ghc
compilerVersion: 9.2.5
compilerVersion: 9.4.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
compilerKind: ghc
compilerVersion: 9.2.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.2
Expand Down Expand Up @@ -73,21 +78,6 @@ jobs:
compilerVersion: 8.2.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-8.0.2
compilerKind: ghc
compilerVersion: 8.0.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.10.3
compilerKind: ghc
compilerVersion: 7.10.3
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.8.4
compilerKind: ghc
compilerVersion: 7.8.4
setup-method: hvr-ppa
allow-failure: false
fail-fast: false
steps:
- name: apt
Expand All @@ -96,19 +86,20 @@ jobs:
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME"
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
env:
HCKIND: ${{ matrix.compilerKind }}
Expand All @@ -122,24 +113,26 @@ jobs:
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
if [ $((HCNUMVER >= 90800)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
Expand Down Expand Up @@ -196,14 +189,14 @@ jobs:
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
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
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
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
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: source
- name: initial cabal.project for sdist
Expand All @@ -227,8 +220,8 @@ jobs:
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_data_interval}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package data-interval" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
echo "package data-interval" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
if $HEADHACKAGE; then
Expand All @@ -241,8 +234,8 @@ jobs:
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: cache
uses: actions/cache@v2
- name: restore cache
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -266,7 +259,7 @@ jobs:
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
Expand All @@ -276,5 +269,13 @@ jobs:
rm -f cabal.project.local
- name: constraint set no-lattices
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='data-interval -lattices' all --dry-run
cabal-plan topo | sort
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='data-interval -lattices' --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='data-interval -lattices' all
- name: save cache
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
26 changes: 6 additions & 20 deletions data-interval.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ Extra-Source-Files:
CHANGELOG.markdown
Build-Type: Simple
Tested-With:
GHC ==7.8.4
GHC ==7.10.3
GHC ==8.0.2
GHC ==8.2.2
GHC ==8.4.4
GHC ==8.6.5
GHC ==8.8.4
GHC ==8.10.7
GHC ==9.0.2
GHC ==9.2.5
GHC ==9.4.4
GHC ==9.6.1
GHC ==9.2.8
GHC ==9.4.7
GHC ==9.6.2
GHC ==9.8.1

source-repository head
type: git
Expand All @@ -43,20 +41,16 @@ flag lattices
Library
Hs-source-dirs: src
Build-Depends:
base >=4 && <5
base >=4.10 && <5
, containers
, deepseq
, hashable >=1.1.2.5 && <1.5
, extended-reals >=0.2 && <1.0
if impl(ghc <8.0)
Build-depends:
semigroups
if flag(lattices)
build-depends:
lattices >=1.2.1.1 && <2.3
Default-Language: Haskell2010
Other-Extensions:
CPP
ScopedTypeVariables
TypeFamilies
DeriveDataTypeable
Expand Down Expand Up @@ -101,15 +95,7 @@ Test-suite test-interval
, tasty-th
, HUnit
, QuickCheck >=2.5 && <3
if impl(ghc >=8.0)
Build-depends:
quickcheck-classes-base
if impl(ghc <8.0)
Build-depends:
semigroups
if impl(ghc <7.10)
Build-depends:
transformers >=0.2
, quickcheck-classes-base
if flag(lattices)
build-depends:
lattices
Expand Down
4 changes: 1 addition & 3 deletions src/Data/IntegerInterval/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE CPP, DeriveDataTypeable, LambdaCase #-}
{-# LANGUAGE DeriveDataTypeable, LambdaCase #-}
{-# LANGUAGE Safe #-}
#if __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE RoleAnnotations #-}
#endif

module Data.IntegerInterval.Internal
( IntegerInterval
Expand Down
2 changes: 0 additions & 2 deletions src/Data/Interval.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{-# OPTIONS_GHC -Wall -fno-warn-orphans #-}
{-# LANGUAGE CPP, LambdaCase, ScopedTypeVariables #-}
{-# LANGUAGE Safe #-}
#if __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE RoleAnnotations #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.Interval
Expand Down
9 changes: 1 addition & 8 deletions src/Data/Interval/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveGeneric, LambdaCase, ScopedTypeVariables #-}
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, LambdaCase, ScopedTypeVariables #-}
{-# LANGUAGE Safe #-}
#if __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE RoleAnnotations #-}
#endif

module Data.Interval.Internal
( Boundary(..)
Expand All @@ -14,9 +12,6 @@ module Data.Interval.Internal
, empty
) where

#if __GLASGOW_HASKELL__ < 710
import Control.Applicative hiding (empty)
#endif
import Control.DeepSeq
import Data.Data
import Data.ExtendedReal
Expand Down Expand Up @@ -140,9 +135,7 @@ upperBound' = \case
RightOpen _ q -> (Finite q, Open)
BothOpen _ q -> (Finite q, Open)

#if __GLASGOW_HASKELL__ >= 708
type role Interval nominal
#endif

instance (Ord r, Data r) => Data (Interval r) where
gfoldl k z x = z interval `k` lowerBound' x `k` upperBound' x
Expand Down
20 changes: 0 additions & 20 deletions src/Data/IntervalMap/Base.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE CPP, LambdaCase, ScopedTypeVariables, TypeFamilies, DeriveDataTypeable, MultiWayIf, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE Trustworthy #-}
#if __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE RoleAnnotations #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.IntervalMap.Base
Expand Down Expand Up @@ -104,16 +102,10 @@ import Data.Interval (Interval)
import qualified Data.Interval as Interval
import Data.IntervalSet (IntervalSet)
import qualified Data.IntervalSet as IntervalSet
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative ((<$>))
import Data.Traversable (Traversable(..))
#endif
#if __GLASGOW_HASKELL__ < 804
import Data.Monoid (Monoid(..))
#endif
#if __GLASGOW_HASKELL__ >= 708
import qualified GHC.Exts as GHCExts
#endif

-- ------------------------------------------------------------------------
-- The IntervalMap type
Expand All @@ -125,9 +117,7 @@ import qualified GHC.Exts as GHCExts
newtype IntervalMap r a = IntervalMap (Map (LB r) (Interval r, a))
deriving (Eq, Typeable)

#if __GLASGOW_HASKELL__ >= 708
type role IntervalMap nominal representational
#endif

instance (Ord k, Show k, Show a) => Show (IntervalMap k a) where
showsPrec p (IntervalMap m) = showParen (p > appPrec) $
Expand Down Expand Up @@ -175,22 +165,12 @@ instance Ord k => Monoid (IntervalMap k a) where

instance Ord k => Semigroup.Semigroup (IntervalMap k a) where
(<>) = union
#if !defined(VERSION_semigroups)
stimes = Semigroup.stimesIdempotentMonoid
#else
#if MIN_VERSION_semigroups(0,17,0)
stimes = Semigroup.stimesIdempotentMonoid
#else
times1p _ a = a
#endif
#endif

#if __GLASGOW_HASKELL__ >= 708
instance Ord k => GHCExts.IsList (IntervalMap k a) where
type Item (IntervalMap k a) = (Interval k, a)
fromList = fromList
toList = toList
#endif

-- ------------------------------------------------------------------------

Expand Down
5 changes: 1 addition & 4 deletions src/Data/IntervalMap/Strict.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE CPP, BangPatterns, TupleSections #-}
{-# LANGUAGE BangPatterns, TupleSections #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
Expand Down Expand Up @@ -126,9 +126,6 @@ import qualified Data.IntervalMap.Base as B
import qualified Data.IntervalSet as IntervalSet
import Data.List (foldl')
import qualified Data.Map.Strict as Map
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative ((<$>))
#endif

-- $strictness
--
Expand Down
2 changes: 1 addition & 1 deletion src/Data/IntervalRelation.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
Expand Down
Loading

0 comments on commit 4115223

Please sign in to comment.