Skip to content

Commit

Permalink
Update for GHC 9.10
Browse files Browse the repository at this point in the history
* Avoid warnings for foldl'
* Bump tested-with GHC versions
  • Loading branch information
meooow25 committed May 20, 2024
1 parent f1e316f commit 85f6b26
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/haskell-ci.yml
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.18
# version: 0.19.20240514
#
# REGENDATA ("0.18",["github","parser-regex.cabal","--branches","master","--installed","-text"])
# REGENDATA ("0.19.20240514",["github","parser-regex.cabal","--branches","master","--installed","-text"])
#
name: Haskell-CI
on:
Expand All @@ -27,19 +27,24 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.8.1
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.8.1
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.4
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.6.4
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.5
compilerKind: ghc
compilerVersion: 9.6.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
Expand Down Expand Up @@ -142,7 +147,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -170,15 +175,15 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(parser-regex|text)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(parser-regex|text)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand Down Expand Up @@ -208,7 +213,7 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
Expand Down
5 changes: 3 additions & 2 deletions parser-regex.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ tested-with:
GHC == 9.0.2
, GHC == 9.2.8
, GHC == 9.4.8
, GHC == 9.6.4
, GHC == 9.8.1
, GHC == 9.6.5
, GHC == 9.8.2
, GHC == 9.10.1

source-repository head
type: git
Expand Down
6 changes: 3 additions & 3 deletions src/Regex/Internal/CharSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Prelude hiding (not, map)
import qualified Prelude
import Data.Char
import Data.String
import Data.Foldable (foldl')
import qualified Data.Foldable as F
import qualified Data.IntMap.Strict as IM
import Data.Semigroup (Semigroup(..), stimesIdempotentMonoid)
import GHC.Exts (Int(..), Char(..), chr#)
Expand All @@ -53,14 +53,14 @@ instance IsString CharSet where
-- | @(<>) = 'union'@
instance Semigroup CharSet where
(<>) = union
sconcat = foldl' union empty
sconcat = F.foldl' union empty
{-# INLINE sconcat #-}
stimes = stimesIdempotentMonoid

-- | @mempty = 'empty'@
instance Monoid CharSet where
mempty = empty
mconcat = foldl' union empty
mconcat = F.foldl' union empty
{-# INLINE mconcat #-}

-- | The empty set.
Expand Down
4 changes: 2 additions & 2 deletions src/Regex/Internal/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module Regex.Internal.Text

import Control.Applicative
import Data.Char
import Data.Foldable (foldl')
import qualified Data.Foldable as F
import Data.Maybe (fromMaybe)
import Numeric.Natural
import Data.Text (Text)
Expand Down Expand Up @@ -558,7 +558,7 @@ reverseConcat ts = case ts of
| otherwise = reverseConcatOverflowError
where
acc' = acc + l
len = foldl' flen 0 ts
len = F.foldl' flen 0 ts
arr = TArray.run $ do
marr <- TArray.new len
let loop !_ [] = pure marr
Expand Down

0 comments on commit 85f6b26

Please sign in to comment.