Commit c9756dbf authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Prepare source-tree for base-4.13 MFP bump

parent b14f5404
Pipeline #1258 passed with stages
in 231 minutes and 14 seconds
......@@ -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'
......
{-# 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
......
......@@ -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
......
......@@ -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
......
......@@ -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,
......
......@@ -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.
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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' })
......
{-# 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
......
{-# 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
......
......@@ -36,4 +36,4 @@ Library
GHC.ForeignSrcLang.Type
GHC.Lexeme
build-depends: base >= 4.7 && < 4.13
build-depends: base >= 4.7 && < 4.14
......@@ -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,
......
......@@ -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
......
{-# 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)
......
......@@ -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,
......
{-# 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")
......
......@@ -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.*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment