From aa9f1553cc2638bf6673677b3c0e7c21c82fb346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Wed, 2 Oct 2024 15:31:46 +0200 Subject: [PATCH] Make it build with ghc 9.8. Adjust CI config --- .github/workflows/cabal.yml | 4 ++-- lib/Language/Haskell/Stylish/Step/SimpleAlign.hs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cabal.yml b/.github/workflows/cabal.yml index 87e477ac..7c226ad6 100644 --- a/.github/workflows/cabal.yml +++ b/.github/workflows/cabal.yml @@ -9,13 +9,13 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest] - ghc: ["9.4", "9.6", "9.8", "9.10"] + ghc: ["9.6", "9.8", "9.10"] fail-fast: false steps: - uses: actions/checkout@v2 - - uses: haskell/actions/setup@v2 + - uses: haskell-actions/setup@v2 name: Setup Haskell Cabal with: ghc-version: ${{ matrix.ghc }} diff --git a/lib/Language/Haskell/Stylish/Step/SimpleAlign.hs b/lib/Language/Haskell/Stylish/Step/SimpleAlign.hs index a0448b2c..55804da9 100644 --- a/lib/Language/Haskell/Stylish/Step/SimpleAlign.hs +++ b/lib/Language/Haskell/Stylish/Step/SimpleAlign.hs @@ -13,6 +13,7 @@ module Language.Haskell.Stylish.Step.SimpleAlign import Data.Either (partitionEithers) import Data.Foldable (toList) import Data.List (foldl1', sortOn) +import qualified Data.List as List import Data.Maybe (fromMaybe) import qualified GHC.Hs as Hs import qualified GHC.Parser.Annotation as GHC @@ -117,7 +118,7 @@ matchToAlignable (GHC.L matchLoc m@(Hs.Match _ Hs.CaseAlt pats@(_ : _) grhss)) = pat = last patsLocs guards = getGuards m guardsLocs = map GHC.getLocA guards - left = foldl' GHC.combineSrcSpans pat guardsLocs + left = List.foldl' GHC.combineSrcSpans pat guardsLocs body <- rhsBody grhss matchPos <- GHC.srcSpanToRealSrcSpan $ GHC.locA matchLoc leftPos <- GHC.srcSpanToRealSrcSpan left