diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2018-12-18 23:36:29 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2019-01-18 17:01:56 -0500 |
commit | c9756dbf1ee58b117ea5c4ded45dea88030efd65 (patch) | |
tree | 66aa32d9fdc0303c3b15f3fdb9605e30d8aa2449 | |
parent | b14f54041eacf8c0f85e756148042d2dca8333f9 (diff) | |
download | haskell-c9756dbf1ee58b117ea5c4ded45dea88030efd65.tar.gz |
Prepare source-tree for base-4.13 MFP bump
-rw-r--r-- | compiler/basicTypes/UniqSupply.hs | 4 | ||||
-rw-r--r-- | compiler/cmm/CmmMonad.hs | 4 | ||||
-rw-r--r-- | compiler/coreSyn/CoreLint.hs | 2 | ||||
-rw-r--r-- | compiler/coreSyn/MkCore.hs | 4 | ||||
-rw-r--r-- | compiler/ghc.cabal.in | 2 | ||||
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 4 | ||||
-rw-r--r-- | compiler/main/GHC.hs | 2 | ||||
-rw-r--r-- | compiler/parser/Lexer.x | 5 | ||||
-rw-r--r-- | compiler/prelude/PrelRules.hs | 2 | ||||
-rw-r--r-- | compiler/specialise/Specialise.hs | 4 | ||||
-rw-r--r-- | compiler/typecheck/TcRnTypes.hs | 2 | ||||
-rw-r--r-- | compiler/typecheck/TcSMonad.hs | 2 | ||||
-rw-r--r-- | compiler/types/Unify.hs | 2 | ||||
-rw-r--r-- | compiler/utils/IOEnv.hs | 3 | ||||
-rw-r--r-- | compiler/utils/ListT.hs | 5 | ||||
-rw-r--r-- | libraries/ghc-boot-th/ghc-boot-th.cabal.in | 2 | ||||
-rw-r--r-- | libraries/ghc-boot/ghc-boot.cabal.in | 2 | ||||
-rw-r--r-- | libraries/ghc-compact/ghc-compact.cabal | 2 | ||||
-rw-r--r-- | libraries/ghci/GHCi/TH.hs | 4 | ||||
-rw-r--r-- | libraries/ghci/ghci.cabal.in | 2 | ||||
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | 4 | ||||
-rw-r--r-- | libraries/template-haskell/template-haskell.cabal | 2 |
22 files changed, 47 insertions, 18 deletions
diff --git a/compiler/basicTypes/UniqSupply.hs b/compiler/basicTypes/UniqSupply.hs index 664600147e..d1ea7e953d 100644 --- a/compiler/basicTypes/UniqSupply.hs +++ b/compiler/basicTypes/UniqSupply.hs @@ -40,7 +40,7 @@ import MonadUtils import Control.Monad import Data.Bits import Data.Char -import Control.Monad.Fail +import Control.Monad.Fail as Fail #include "Unique.h" @@ -150,7 +150,7 @@ instance Applicative UniqSM where (*>) = thenUs_ -- TODO: try to get rid of this instance -instance MonadFail UniqSM where +instance Fail.MonadFail UniqSM where fail = panic -- | Run the 'UniqSM' action, returning the final 'UniqSupply' diff --git a/compiler/cmm/CmmMonad.hs b/compiler/cmm/CmmMonad.hs index f3b4441a9b..821c0a6504 100644 --- a/compiler/cmm/CmmMonad.hs +++ b/compiler/cmm/CmmMonad.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + ----------------------------------------------------------------------------- -- A Parser monad with access to the 'DynFlags'. -- @@ -31,7 +33,9 @@ instance Applicative PD where instance Monad PD where (>>=) = thenPD +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif instance MonadFail.MonadFail PD where fail = failPD diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index b1b37c51be..53cddbfabe 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -2160,7 +2160,9 @@ instance Applicative LintM where (<*>) = ap instance Monad LintM where +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif m >>= k = LintM (\ env errs -> let (res, errs') = unLintM m env errs in case res of diff --git a/compiler/coreSyn/MkCore.hs b/compiler/coreSyn/MkCore.hs index 4fa824a7dc..1d07399293 100644 --- a/compiler/coreSyn/MkCore.hs +++ b/compiler/coreSyn/MkCore.hs @@ -81,7 +81,7 @@ import DynFlags import Data.List import Data.Char ( ord ) -import Control.Monad.Fail ( MonadFail ) +import Control.Monad.Fail as MonadFail ( MonadFail ) infixl 4 `mkCoreApp`, `mkCoreApps` @@ -600,7 +600,7 @@ mkFoldrExpr elt_ty result_ty c n list = do `App` list) -- | Make a 'build' expression applied to a locally-bound worker function -mkBuildExpr :: (MonadFail m, MonadThings m, MonadUnique m) +mkBuildExpr :: (MonadFail.MonadFail m, MonadThings m, MonadUnique m) => Type -- ^ Type of list elements to be built -> ((Id, Type) -> (Id, Type) -> m CoreExpr) -- ^ Function that, given information about the 'Id's -- of the binders for the build worker function, returns diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 4be4d60cb7..a02ce1297d 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -59,7 +59,7 @@ Library Default-Language: Haskell2010 Exposed: False - Build-Depends: base >= 4.9 && < 5, + Build-Depends: base >= 4.11 && < 4.14, deepseq >= 1.4 && < 1.5, directory >= 1 && < 1.4, process >= 1 && < 1.7, diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 6071bd82e5..f6b47b091c 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1658,7 +1658,7 @@ getCmmReg (CmmLocal (LocalReg un _)) dflags <- getDynFlags case exists of Just ety -> return (LMLocalVar un $ pLift ety) - Nothing -> fail $ "getCmmReg: Cmm register " ++ showSDoc dflags (ppr un) ++ " was not allocated!" + Nothing -> panic $ "getCmmReg: Cmm register " ++ showSDoc dflags (ppr un) ++ " was not allocated!" -- This should never happen, as every local variable should -- have been assigned a value at some point, triggering -- "funPrologue" to allocate it on the stack. @@ -1668,7 +1668,7 @@ getCmmReg (CmmGlobal g) dflags <- getDynFlags if onStack then return (lmGlobalRegVar dflags g) - else fail $ "getCmmReg: Cmm register " ++ showSDoc dflags (ppr g) ++ " not stack-allocated!" + else panic $ "getCmmReg: Cmm register " ++ showSDoc dflags (ppr g) ++ " not stack-allocated!" -- | Return the value of a given register, as well as its type. Might -- need to be load from stack. diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index f289cd4229..471a558cc6 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -522,7 +522,7 @@ checkBrokenTablesNextToCode dflags = do { broken <- checkBrokenTablesNextToCode' dflags ; when broken $ do { _ <- liftIO $ throwIO $ mkApiErr dflags invalidLdErr - ; fail "unsupported linker" + ; liftIO $ fail "unsupported linker" } } where diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index c64c0173e8..c4d0d4d127 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -41,6 +41,7 @@ -- Alex "Haskell code fragment top" { +{-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} @@ -2015,9 +2016,11 @@ instance Applicative P where instance Monad P where (>>=) = thenP +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif -instance MonadFail P where +instance MonadFail.MonadFail P where fail = failP returnP :: a -> P a diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs index cd04074545..f8b8f91bcc 100644 --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -749,7 +749,9 @@ instance Monad RuleM where RuleM f >>= g = RuleM $ \dflags iu e -> case f dflags iu e of Nothing -> Nothing Just r -> runRuleM (g r) dflags iu e +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif instance MonadFail.MonadFail RuleM where fail _ = mzero diff --git a/compiler/specialise/Specialise.hs b/compiler/specialise/Specialise.hs index d5e64e3dc0..f391781c43 100644 --- a/compiler/specialise/Specialise.hs +++ b/compiler/specialise/Specialise.hs @@ -2287,10 +2287,12 @@ instance Monad SpecM where case f y of SpecM z -> z +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif instance MonadFail.MonadFail SpecM where - fail str = SpecM $ fail str + fail str = SpecM $ error str instance MonadUnique SpecM where getUniqueSupplyM diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 205a2bda03..b9e5b6ca8f 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -3844,7 +3844,9 @@ instance Applicative TcPluginM where (<*>) = ap instance Monad TcPluginM where +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif TcPluginM m >>= k = TcPluginM (\ ev -> do a <- m ev runTcPluginM (k a) ev) diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 69f58b9002..a845623aaa 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -2611,7 +2611,9 @@ instance Applicative TcS where (<*>) = ap instance Monad TcS where +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif m >>= k = TcS (\ebs -> unTcS m ebs >>= \r -> unTcS (k r) ebs) instance MonadFail.MonadFail TcS where diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index 1e5406db2e..d13266660b 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -1215,7 +1215,9 @@ instance Applicative UM where (<*>) = ap instance Monad UM where +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif m >>= k = UM (\state -> do { (state', v) <- unUM m state ; unUM (k v) state' }) diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs index 4640b2b7c2..d6807da71a 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/utils/IOEnv.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} -- -- (c) The University of Glasgow 2002-2006 -- @@ -58,7 +59,9 @@ unIOEnv (IOEnv m) = m instance Monad (IOEnv m) where (>>=) = thenM (>>) = (*>) +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif instance MonadFail.MonadFail (IOEnv m) where fail _ = failM -- Ignore the string diff --git a/compiler/utils/ListT.hs b/compiler/utils/ListT.hs index c16701419d..105e27b3d4 100644 --- a/compiler/utils/ListT.hs +++ b/compiler/utils/ListT.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE FlexibleInstances #-} @@ -67,9 +68,11 @@ instance Alternative (ListT f) where instance Monad (ListT m) where m >>= f = ListT $ \sk fk -> unListT m (\a fk' -> unListT (f a) sk fk') fk +#if !MIN_VERSION_base(4,13,0) fail = MonadFail.fail +#endif -instance MonadFail (ListT m) where +instance MonadFail.MonadFail (ListT m) where fail _ = ListT $ \_ fk -> fk instance MonadPlus (ListT m) where diff --git a/libraries/ghc-boot-th/ghc-boot-th.cabal.in b/libraries/ghc-boot-th/ghc-boot-th.cabal.in index b52c8ab570..657055d93d 100644 --- a/libraries/ghc-boot-th/ghc-boot-th.cabal.in +++ b/libraries/ghc-boot-th/ghc-boot-th.cabal.in @@ -36,4 +36,4 @@ Library GHC.ForeignSrcLang.Type GHC.Lexeme - build-depends: base >= 4.7 && < 4.13 + build-depends: base >= 4.7 && < 4.14 diff --git a/libraries/ghc-boot/ghc-boot.cabal.in b/libraries/ghc-boot/ghc-boot.cabal.in index 58311b6ab9..863987beab 100644 --- a/libraries/ghc-boot/ghc-boot.cabal.in +++ b/libraries/ghc-boot/ghc-boot.cabal.in @@ -43,7 +43,7 @@ Library GHC.ForeignSrcLang GHC.HandleEncoding - build-depends: base >= 4.7 && < 4.13, + build-depends: base >= 4.7 && < 4.14, binary == 0.8.*, bytestring == 0.10.*, directory >= 1.2 && < 1.4, diff --git a/libraries/ghc-compact/ghc-compact.cabal b/libraries/ghc-compact/ghc-compact.cabal index f5f6f2a3d9..d7572ff11a 100644 --- a/libraries/ghc-compact/ghc-compact.cabal +++ b/libraries/ghc-compact/ghc-compact.cabal @@ -37,7 +37,7 @@ library CPP build-depends: ghc-prim == 0.5.3.*, - base >= 4.9.0 && < 4.13, + base >= 4.9.0 && < 4.14, bytestring >= 0.10.6.0 ghc-options: -Wall diff --git a/libraries/ghci/GHCi/TH.hs b/libraries/ghci/GHCi/TH.hs index 04c5fcffcc..d9f4443d14 100644 --- a/libraries/ghci/GHCi/TH.hs +++ b/libraries/ghci/GHCi/TH.hs @@ -1,5 +1,5 @@ {-# LANGUAGE ScopedTypeVariables, StandaloneDeriving, DeriveGeneric, - TupleSections, RecordWildCards, InstanceSigs #-} + TupleSections, RecordWildCards, InstanceSigs, CPP #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} -- | @@ -144,7 +144,9 @@ instance Monad GHCiQ where do (m', s') <- runGHCiQ m s (a, s'') <- runGHCiQ (f m') s' return (a, s'') +#if !MIN_VERSION_base(4,13,0) fail = Fail.fail +#endif instance Fail.MonadFail GHCiQ where fail err = GHCiQ $ \s -> throwIO (GHCiQException s err) diff --git a/libraries/ghci/ghci.cabal.in b/libraries/ghci/ghci.cabal.in index 467ed8f564..4b8100b9e2 100644 --- a/libraries/ghci/ghci.cabal.in +++ b/libraries/ghci/ghci.cabal.in @@ -70,7 +70,7 @@ library Build-Depends: array == 0.5.*, - base >= 4.8 && < 4.13, + base >= 4.8 && < 4.14, binary == 0.8.*, bytestring == 0.10.*, containers >= 0.5 && < 0.7, diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs index 770fac7580..705222a2f9 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable, +{-# LANGUAGE CPP, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, DefaultSignatures, RankNTypes, RoleAnnotations, ScopedTypeVariables, Trustworthy #-} @@ -178,7 +178,9 @@ runQ (Q m) = m instance Monad Q where Q m >>= k = Q (m >>= \x -> unQ (k x)) (>>) = (*>) +#if !MIN_VERSION_base(4,13,0) fail = Fail.fail +#endif instance Fail.MonadFail Q where fail s = report True s >> Q (Fail.fail "Q monad failure") diff --git a/libraries/template-haskell/template-haskell.cabal b/libraries/template-haskell/template-haskell.cabal index 90d67fc774..cdb60c4709 100644 --- a/libraries/template-haskell/template-haskell.cabal +++ b/libraries/template-haskell/template-haskell.cabal @@ -51,7 +51,7 @@ Library Language.Haskell.TH.Lib.Map build-depends: - base >= 4.9 && < 4.13, + base >= 4.11 && < 4.14, ghc-boot-th == 8.7.*, pretty == 1.1.* |