From ae3990a7b2451c06a8c15124372894fa7f3f4157 Mon Sep 17 00:00:00 2001 From: Gergo ERDI Date: Fri, 11 Oct 2024 03:57:55 +0100 Subject: [PATCH] GHC-9.8 compatibility: import `foldl'` from `Data.List` Part of #2379 --- liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs | 5 +++++ liquidhaskell-boot/src-ghc/Liquid/GHC/API/Extra.hs | 1 + liquidhaskell-boot/src/Language/Haskell/Liquid/Parse.hs | 1 + .../src/Language/Haskell/Liquid/UX/QuasiQuoter.hs | 1 + 4 files changed, 8 insertions(+) diff --git a/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs b/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs index 6937e86195..10c20b8700 100644 --- a/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs +++ b/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs @@ -2,8 +2,13 @@ module Liquid.GHC.API.Compat ( UniqueId , toUniqueId + + , foldl' ) where +#if !MIN_VERSION_ghc(9,10,0) +import Data.List (foldl') +#endif import Data.Word (Word64) ---------------------- diff --git a/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Extra.hs b/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Extra.hs index e9d35d96a1..d7c2d3c334 100644 --- a/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Extra.hs +++ b/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Extra.hs @@ -34,6 +34,7 @@ module Liquid.GHC.API.Extra ( import Control.Monad.IO.Class import Liquid.GHC.API.StableModule as StableModule +import Liquid.GHC.API.Compat (foldl') import GHC import Data.Data (Data, gmapQr, gmapT) import Data.Generics (extQ, extT) diff --git a/liquidhaskell-boot/src/Language/Haskell/Liquid/Parse.hs b/liquidhaskell-boot/src/Language/Haskell/Liquid/Parse.hs index 2a29e81d42..004e8302a7 100644 --- a/liquidhaskell-boot/src/Language/Haskell/Liquid/Parse.hs +++ b/liquidhaskell-boot/src/Language/Haskell/Liquid/Parse.hs @@ -39,6 +39,7 @@ import qualified Text.PrettyPrint.HughesPJ as PJ import Text.PrettyPrint.HughesPJ.Compat ((<+>)) import Language.Fixpoint.Types hiding (panic, SVar, DDecl, DataDecl, DataCtor (..), Error, R, Predicate) import Language.Haskell.Liquid.GHC.Misc hiding (getSourcePos) +import Liquid.GHC.API.Compat import Language.Haskell.Liquid.Types -- import Language.Haskell.Liquid.Types.Errors import qualified Language.Fixpoint.Misc as Misc diff --git a/liquidhaskell-boot/src/Language/Haskell/Liquid/UX/QuasiQuoter.hs b/liquidhaskell-boot/src/Language/Haskell/Liquid/UX/QuasiQuoter.hs index e52a257365..cd42be883f 100644 --- a/liquidhaskell-boot/src/Language/Haskell/Liquid/UX/QuasiQuoter.hs +++ b/liquidhaskell-boot/src/Language/Haskell/Liquid/UX/QuasiQuoter.hs @@ -28,6 +28,7 @@ import qualified Language.Fixpoint.Types as F import Language.Haskell.Liquid.GHC.Misc (fSrcSpan) import Liquid.GHC.API (SrcSpan) +import Liquid.GHC.API.Compat import Language.Haskell.Liquid.Parse import Language.Haskell.Liquid.Types