Skip to content

Commit 42d6d54

Browse files
authored
Merge pull request #41 from haskellari/noble
Drop support for GHCs prior 8.6.5
2 parents b975c06 + f1d4da7 commit 42d6d54

File tree

7 files changed

+45
-179
lines changed

7 files changed

+45
-179
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 32 additions & 120 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.19.20240402
11+
# version: 0.19.20240501
1212
#
13-
# REGENDATA ("0.19.20240402",["github","integer-logarithms.cabal"])
13+
# REGENDATA ("0.19.20240501",["github","integer-logarithms.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -27,19 +27,14 @@ jobs:
2727
timeout-minutes:
2828
60
2929
container:
30-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghcjs-8.4
36-
compilerKind: ghcjs
37-
compilerVersion: "8.4"
38-
setup-method: hvr-ppa
39-
allow-failure: false
40-
- compiler: ghc-9.10.0.20240328
35+
- compiler: ghc-9.10.0.20240426
4136
compilerKind: ghc
42-
compilerVersion: 9.10.0.20240328
37+
compilerVersion: 9.10.0.20240426
4338
setup-method: ghcup
4439
allow-failure: false
4540
- compiler: ghc-9.8.2
@@ -70,136 +65,55 @@ jobs:
7065
- compiler: ghc-8.10.4
7166
compilerKind: ghc
7267
compilerVersion: 8.10.4
73-
setup-method: hvr-ppa
68+
setup-method: ghcup
7469
allow-failure: false
7570
- compiler: ghc-8.8.4
7671
compilerKind: ghc
7772
compilerVersion: 8.8.4
78-
setup-method: hvr-ppa
79-
allow-failure: false
80-
- compiler: ghc-8.6.4
81-
compilerKind: ghc
82-
compilerVersion: 8.6.4
83-
setup-method: hvr-ppa
84-
allow-failure: false
85-
- compiler: ghc-8.4.4
86-
compilerKind: ghc
87-
compilerVersion: 8.4.4
88-
setup-method: hvr-ppa
89-
allow-failure: false
90-
- compiler: ghc-8.2.2
91-
compilerKind: ghc
92-
compilerVersion: 8.2.2
93-
setup-method: hvr-ppa
94-
allow-failure: false
95-
- compiler: ghc-8.0.2
96-
compilerKind: ghc
97-
compilerVersion: 8.0.2
98-
setup-method: hvr-ppa
99-
allow-failure: false
100-
- compiler: ghc-7.10.3
101-
compilerKind: ghc
102-
compilerVersion: 7.10.3
103-
setup-method: hvr-ppa
104-
allow-failure: false
105-
- compiler: ghc-7.8.4
106-
compilerKind: ghc
107-
compilerVersion: 7.8.4
108-
setup-method: hvr-ppa
109-
allow-failure: false
110-
- compiler: ghc-7.6.3
111-
compilerKind: ghc
112-
compilerVersion: 7.6.3
113-
setup-method: hvr-ppa
114-
allow-failure: false
115-
- compiler: ghc-7.4.2
116-
compilerKind: ghc
117-
compilerVersion: 7.4.2
118-
setup-method: hvr-ppa
119-
allow-failure: false
120-
- compiler: ghc-7.2.2
121-
compilerKind: ghc
122-
compilerVersion: 7.2.2
123-
setup-method: hvr-ppa
73+
setup-method: ghcup
12474
allow-failure: false
125-
- compiler: ghc-7.0.4
75+
- compiler: ghc-8.6.5
12676
compilerKind: ghc
127-
compilerVersion: 7.0.4
128-
setup-method: hvr-ppa
77+
compilerVersion: 8.6.5
78+
setup-method: ghcup
12979
allow-failure: false
13080
fail-fast: false
13181
steps:
132-
- name: Set GHCJS environment variables
133-
run: |
134-
if [ $HCKIND = ghcjs ]; then
135-
echo "GHCJS=true" >> "$GITHUB_ENV"
136-
echo "GHCJSARITH=1" >> "$GITHUB_ENV"
137-
else
138-
echo "GHCJS=false" >> "$GITHUB_ENV"
139-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
140-
fi
141-
env:
142-
HCKIND: ${{ matrix.compilerKind }}
143-
HCNAME: ${{ matrix.compiler }}
144-
HCVER: ${{ matrix.compilerVersion }}
14582
- name: apt
14683
run: |
14784
apt-get update
14885
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
149-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
150-
mkdir -p "$HOME/.ghcup/bin"
151-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
152-
chmod a+x "$HOME/.ghcup/bin/ghcup"
153-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
154-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
155-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
156-
else
157-
apt-add-repository -y 'ppa:hvr/ghc'
158-
if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi
159-
if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi
160-
if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x bionic main' ; fi
161-
apt-get update
162-
if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi
163-
mkdir -p "$HOME/.ghcup/bin"
164-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
165-
chmod a+x "$HOME/.ghcup/bin/ghcup"
166-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
167-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
168-
fi
86+
mkdir -p "$HOME/.ghcup/bin"
87+
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
88+
chmod a+x "$HOME/.ghcup/bin/ghcup"
89+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
90+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
91+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
16992
env:
17093
HCKIND: ${{ matrix.compilerKind }}
17194
HCNAME: ${{ matrix.compiler }}
17295
HCVER: ${{ matrix.compilerVersion }}
17396
- name: Set PATH and environment variables
17497
run: |
17598
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
176-
if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi
17799
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
178100
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
179101
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
180102
HCDIR=/opt/$HCKIND/$HCVER
181-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
182-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
183-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
184-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
185-
echo "HC=$HC" >> "$GITHUB_ENV"
186-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
187-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
188-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
189-
else
190-
HC=$HCDIR/bin/$HCKIND
191-
echo "HC=$HC" >> "$GITHUB_ENV"
192-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
193-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
194-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
195-
fi
196-
103+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
104+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
105+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
106+
echo "HC=$HC" >> "$GITHUB_ENV"
107+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
108+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
109+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
197110
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
198111
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
199-
if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 70400)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi
112+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
200113
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
201114
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
202115
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
116+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
203117
env:
204118
HCKIND: ${{ matrix.compilerKind }}
205119
HCNAME: ${{ matrix.compiler }}
@@ -236,8 +150,6 @@ jobs:
236150
$HC --version || true
237151
$HC --print-project-git-commit-id || true
238152
$CABAL --version || true
239-
if [ $((GHCJSARITH)) -ne 0 ] ; then node --version ; fi
240-
if [ $((GHCJSARITH)) -ne 0 ] ; then echo $GHCJS ; fi
241153
- name: update cabal index
242154
run: |
243155
$CABAL v2-update -v
@@ -251,7 +163,7 @@ jobs:
251163
chmod a+x $HOME/.cabal/bin/cabal-plan
252164
cabal-plan --version
253165
- name: checkout
254-
uses: actions/checkout@v3
166+
uses: actions/checkout@v4
255167
with:
256168
path: source
257169
- name: initial cabal.project for sdist
@@ -275,8 +187,8 @@ jobs:
275187
touch cabal.project
276188
touch cabal.project.local
277189
echo "packages: ${PKGDIR_integer_logarithms}" >> cabal.project
278-
if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package integer-logarithms" >> cabal.project ; fi
279-
if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
190+
echo "package integer-logarithms" >> cabal.project
191+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
280192
cat >> cabal.project <<EOF
281193
EOF
282194
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(integer-logarithms)$/; }' >> cabal.project.local
@@ -287,7 +199,7 @@ jobs:
287199
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
288200
cabal-plan
289201
- name: restore cache
290-
uses: actions/cache/restore@v3
202+
uses: actions/cache/restore@v4
291203
with:
292204
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
293205
path: ~/.cabal/store
@@ -304,14 +216,14 @@ jobs:
304216
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
305217
- name: tests
306218
run: |
307-
if [ $((! GHCJSARITH && HCNUMVER >= 70400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi
219+
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
308220
- name: cabal check
309221
run: |
310222
cd ${PKGDIR_integer_logarithms} || false
311223
${CABAL} -vnormal check
312224
- name: haddock
313225
run: |
314-
if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
226+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
315227
- name: unconstrained build
316228
run: |
317229
rm -f cabal.project.local
@@ -326,7 +238,7 @@ jobs:
326238
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='integer-logarithms +check-bounds' --dependencies-only -j2 all
327239
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='integer-logarithms +check-bounds' all
328240
- name: save cache
329-
uses: actions/cache/save@v3
241+
uses: actions/cache/save@v4
330242
if: always()
331243
with:
332244
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
1.0.4
2+
-----
3+
4+
- Drop support for GHCs prior 8.6.5
5+
16
1.0.3.1
27
-------
38

integer-logarithms.cabal

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: integer-logarithms
2-
version: 1.0.3.1
3-
x-revision: 6
2+
version: 1.0.4
43
cabal-version: >=1.10
54
author: Daniel Fischer
65
copyright:
@@ -24,16 +23,7 @@ description:
2423

2524
category: Math, Algorithms, Number Theory
2625
tested-with:
27-
GHC ==7.0.4
28-
|| ==7.2.2
29-
|| ==7.4.2
30-
|| ==7.6.3
31-
|| ==7.8.4
32-
|| ==7.10.3
33-
|| ==8.0.2
34-
|| ==8.2.2
35-
|| ==8.4.4
36-
|| ==8.6.4
26+
GHC ==8.6.5
3727
|| ==8.8.4
3828
|| ==8.10.4
3929
|| ==9.0.2
@@ -42,7 +32,6 @@ tested-with:
4232
|| ==9.6.4
4333
|| ==9.8.2
4434
|| ==9.10.1
45-
, GHCJS ==8.4
4635

4736
extra-source-files:
4837
changelog.md
@@ -62,8 +51,8 @@ library
6251
default-language: Haskell2010
6352
hs-source-dirs: src
6453
build-depends:
65-
array >=0.3 && <0.6
66-
, base >=4.3 && <4.21
54+
array >=0.5.3.0 && <0.6
55+
, base >=4.12.0.0 && <4.21
6756
, ghc-prim <0.12
6857

6958
if !impl(ghc >=7.10)
@@ -125,14 +114,11 @@ test-suite spec
125114
, integer-logarithms
126115
, QuickCheck >=2.14.1 && <2.15
127116
, smallcheck >=1.2 && <1.3
128-
, tasty >=0.10 && <1.6
129-
, tasty-hunit >=0.9 && <0.11
130-
, tasty-quickcheck >=0.8 && <0.11
117+
, tasty >=1.4 && <1.6
118+
, tasty-hunit >=0.10 && <0.11
119+
, tasty-quickcheck >=0.10 && <0.11
131120
, tasty-smallcheck >=0.8 && <0.9
132121

133-
if !impl(ghc >=7.10)
134-
build-depends: nats ==1.1.*
135-
136122
other-modules:
137123
Math.NumberTheory.LogarithmsTests
138124
Math.NumberTheory.TestUtils

src/Math/NumberTheory/Logarithms.hs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
--
1212
{-# LANGUAGE CPP #-}
1313
{-# LANGUAGE MagicHash #-}
14-
#if __GLASGOW_HASKELL__ >= 702
1514
{-# LANGUAGE Trustworthy #-}
16-
#endif
1715
module Math.NumberTheory.Logarithms
1816
( -- * Integer logarithms with input checks
1917
integerLogBase
@@ -330,9 +328,3 @@ naturalLog2# (NatJ# n) = integerLog2# (Jp# n)
330328
naturalLog2# n = integerLog2# (toInteger n)
331329
#endif
332330
#endif
333-
334-
#if __GLASGOW_HASKELL__ < 707
335-
-- The times they are a-changing. The types of primops too :(
336-
isTrue# :: Bool -> Bool
337-
isTrue# = id
338-
#endif

src/Math/NumberTheory/Powers/Integer.hs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,13 @@
99
-- Potentially faster power function for 'Integer' base and 'Int'
1010
-- or 'Word' exponent.
1111
--
12-
{-# LANGUAGE CPP #-}
13-
#if __GLASGOW_HASKELL__ >= 702
14-
#if __GLASGOW_HASKELL__ >= 704
1512
{-# LANGUAGE Safe #-}
16-
#else
17-
{-# LANGUAGE Trustworthy #-}
18-
#endif
19-
#endif
2013
module Math.NumberTheory.Powers.Integer
2114
{-# DEPRECATED "It is no faster than (^)" #-}
2215
( integerPower
2316
, integerWordPower
2417
) where
2518

26-
#if !MIN_VERSION_base(4,8,0)
27-
import Data.Word
28-
#endif
29-
3019
-- | Power of an 'Integer' by the left-to-right repeated squaring algorithm.
3120
-- This needs two multiplications in each step while the right-to-left
3221
-- algorithm needs only one multiplication for 0-bits, but here the

src/Math/NumberTheory/Powers/Natural.hs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,14 @@
99
-- Potentially faster power function for 'Natural' base and 'Int'
1010
-- or 'Word' exponent.
1111
--
12-
{-# LANGUAGE CPP #-}
13-
#if __GLASGOW_HASKELL__ >= 702
14-
#if __GLASGOW_HASKELL__ >= 704
1512
{-# LANGUAGE Safe #-}
16-
#else
17-
{-# LANGUAGE Trustworthy #-}
18-
#endif
19-
#endif
2013
module Math.NumberTheory.Powers.Natural
2114
{-# DEPRECATED "It is no faster than (^)" #-}
2215
( naturalPower
2316
, naturalWordPower
2417
) where
2518

26-
#if !MIN_VERSION_base(4,8,0)
27-
import Data.Word
28-
#endif
29-
30-
import Numeric.Natural
19+
import Numeric.Natural (Natural)
3120

3221
-- | Power of an 'Natural' by the left-to-right repeated squaring algorithm.
3322
-- This needs two multiplications in each step while the right-to-left

0 commit comments

Comments
 (0)