summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-06-12 08:42:49 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-06-12 08:42:49 +0100
commit2742aa780a909b633c693273a86678a6cbe0a637 (patch)
tree771f6e73cc4012f13caeded1d15f0b12c9c47b6d
parent4f8e86b44ecc31056d0bd7af325b9bb239ddf7a0 (diff)
parent24d9d1016304c736d74834b681dd7d9052de5ee6 (diff)
downloadhaskell-2742aa780a909b633c693273a86678a6cbe0a637.tar.gz
Merge branch 'master' of http://darcs.haskell.org/ghc
-rw-r--r--compiler/main/DynFlags.hs30
-rw-r--r--compiler/main/HscMain.hs16
-rw-r--r--compiler/main/HscTypes.lhs22
-rw-r--r--compiler/typecheck/TcRnTypes.lhs5
-rw-r--r--ghc/InteractiveUI.hs2
5 files changed, 38 insertions, 37 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 179a40c751..5775c35ed1 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -373,15 +373,15 @@ data SafeHaskellMode
| Sf_Unsafe
| Sf_Trustworthy
| Sf_Safe
- | Sf_SafeInfered
+ | Sf_SafeInferred
deriving (Eq)
instance Outputable SafeHaskellMode where
- ppr Sf_None = ptext $ sLit "None"
- ppr Sf_Unsafe = ptext $ sLit "Unsafe"
- ppr Sf_Trustworthy = ptext $ sLit "Trustworthy"
- ppr Sf_Safe = ptext $ sLit "Safe"
- ppr Sf_SafeInfered = ptext $ sLit "Safe-Infered"
+ ppr Sf_None = ptext $ sLit "None"
+ ppr Sf_Unsafe = ptext $ sLit "Unsafe"
+ ppr Sf_Trustworthy = ptext $ sLit "Trustworthy"
+ ppr Sf_Safe = ptext $ sLit "Safe"
+ ppr Sf_SafeInferred = ptext $ sLit "Safe-Inferred"
data ExtensionFlag
= Opt_Cpp
@@ -949,7 +949,7 @@ defaultDynFlags mySettings =
warningFlags = IntSet.fromList (map fromEnum standardWarnings),
ghciScripts = [],
language = Nothing,
- safeHaskell = Sf_SafeInfered,
+ safeHaskell = Sf_SafeInferred,
thOnLoc = noSrcSpan,
newDerivOnLoc = noSrcSpan,
pkgTrustOnLoc = noSrcSpan,
@@ -1137,7 +1137,7 @@ safeLanguageOn dflags = safeHaskell dflags == Sf_Safe
-- | Is the Safe Haskell safe inference mode active
safeInferOn :: DynFlags -> Bool
-safeInferOn dflags = safeHaskell dflags == Sf_SafeInfered
+safeInferOn dflags = safeHaskell dflags == Sf_SafeInferred
-- | Test if Safe Imports are on in some form
safeImportsOn :: DynFlags -> Bool
@@ -1168,12 +1168,12 @@ safeImplicitImpsReq d = safeLanguageOn d
-- want to export this functionality from the module but do want to export the
-- type constructors.
combineSafeFlags :: SafeHaskellMode -> SafeHaskellMode -> DynP SafeHaskellMode
-combineSafeFlags a b | a == Sf_SafeInfered = return b
- | b == Sf_SafeInfered = return a
- | a == Sf_None = return b
- | b == Sf_None = return a
- | a == b = return a
- | otherwise = addErr errm >> return (panic errm)
+combineSafeFlags a b | a == Sf_SafeInferred = return b
+ | b == Sf_SafeInferred = return a
+ | a == Sf_None = return b
+ | b == Sf_None = return a
+ | a == b = return a
+ | otherwise = addErr errm >> return (panic errm)
where errm = "Incompatible Safe Haskell flags! ("
++ showPpr a ++ ", " ++ showPpr b ++ ")"
@@ -1423,7 +1423,7 @@ safeFlagCheck cmdl dflags =
| otherwise
-> (dflags' { safeHaskell = Sf_None }, [])
- -- Have we infered Unsafe?
+ -- Have we inferred Unsafe?
-- See Note [HscMain . Safe Haskell Inference]
where
-- TODO: Can we do better than this for inference?
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index ba4bfbc7b2..fdef71036c 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -447,7 +447,7 @@ tcRnModule' hsc_env sum save_rn_syntax mod = do
return tcg_res'
where
pprMod t = ppr $ moduleName $ tcg_mod t
- errSafe t = quotes (pprMod t) <+> text "has been infered as safe!"
+ errSafe t = quotes (pprMod t) <+> text "has been inferred as safe!"
-- | Convert a typechecked module to Core
hscDesugar :: HscEnv -> ModSummary -> TcGblEnv -> IO ModGuts
@@ -927,7 +927,7 @@ hscCheckSafeImports tcg_env = do
safeHaskell dflags == Sf_None
-> wipeTrust tcg_env' $ warns (tcg_rules tcg_env')
- -- trustworthy OR safe infered with no RULES
+ -- trustworthy OR safe inferred with no RULES
| otherwise
-> return tcg_env'
@@ -1049,7 +1049,7 @@ hscCheckSafe' dflags m l = do
let trust = getSafeMode $ mi_trust iface'
trust_own_pkg = mi_trust_pkg iface'
-- check module is trusted
- safeM = trust `elem` [Sf_SafeInfered, Sf_Safe, Sf_Trustworthy]
+ safeM = trust `elem` [Sf_SafeInferred, Sf_Safe, Sf_Trustworthy]
-- check package is trusted
safeP = packageTrusted trust trust_own_pkg m
-- pkg trust reqs
@@ -1079,9 +1079,9 @@ hscCheckSafe' dflags m l = do
-- otherwise we check the package trust flag.
packageTrusted :: SafeHaskellMode -> Bool -> Module -> Bool
packageTrusted _ _ _
- | not (packageTrustOn dflags) = True
- packageTrusted Sf_Safe False _ = True
- packageTrusted Sf_SafeInfered False _ = True
+ | not (packageTrustOn dflags) = True
+ packageTrusted Sf_Safe False _ = True
+ packageTrusted Sf_SafeInferred False _ = True
packageTrusted _ _ m
| isHomePkg m = True
| otherwise = trusted $ getPackageDetails (pkgState dflags)
@@ -1130,7 +1130,7 @@ checkPkgTrust dflags pkgs =
-- | Set module to unsafe and wipe trust information.
--
--- Make sure to call this method to set a module to infered unsafe,
+-- Make sure to call this method to set a module to inferred unsafe,
-- it should be a central and single failure method.
wipeTrust :: TcGblEnv -> WarningMessages -> Hsc TcGblEnv
wipeTrust tcg_env whyUnsafe = do
@@ -1146,7 +1146,7 @@ wipeTrust tcg_env whyUnsafe = do
where
wiped_trust = (tcg_imports tcg_env) { imp_trust_pkgs = [] }
pprMod = ppr $ moduleName $ tcg_mod tcg_env
- whyUnsafe' df = vcat [ quotes pprMod <+> text "has been infered as unsafe!"
+ whyUnsafe' df = vcat [ quotes pprMod <+> text "has been inferred as unsafe!"
, text "Reason:"
, nest 4 $ (vcat $ badFlags df) $+$
(vcat $ pprErrMsgBagWithLoc whyUnsafe)
diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs
index 1c8276db33..d07ef88228 100644
--- a/compiler/main/HscTypes.lhs
+++ b/compiler/main/HscTypes.lhs
@@ -2059,26 +2059,26 @@ noIfaceTrustInfo = setSafeMode Sf_None
trustInfoToNum :: IfaceTrustInfo -> Word8
trustInfoToNum it
= case getSafeMode it of
- Sf_None -> 0
- Sf_Unsafe -> 1
- Sf_Trustworthy -> 2
- Sf_Safe -> 3
- Sf_SafeInfered -> 4
+ Sf_None -> 0
+ Sf_Unsafe -> 1
+ Sf_Trustworthy -> 2
+ Sf_Safe -> 3
+ Sf_SafeInferred -> 4
numToTrustInfo :: Word8 -> IfaceTrustInfo
numToTrustInfo 0 = setSafeMode Sf_None
numToTrustInfo 1 = setSafeMode Sf_Unsafe
numToTrustInfo 2 = setSafeMode Sf_Trustworthy
numToTrustInfo 3 = setSafeMode Sf_Safe
-numToTrustInfo 4 = setSafeMode Sf_SafeInfered
+numToTrustInfo 4 = setSafeMode Sf_SafeInferred
numToTrustInfo n = error $ "numToTrustInfo: bad input number! (" ++ show n ++ ")"
instance Outputable IfaceTrustInfo where
- ppr (TrustInfo Sf_None) = ptext $ sLit "none"
- ppr (TrustInfo Sf_Unsafe) = ptext $ sLit "unsafe"
- ppr (TrustInfo Sf_Trustworthy) = ptext $ sLit "trustworthy"
- ppr (TrustInfo Sf_Safe) = ptext $ sLit "safe"
- ppr (TrustInfo Sf_SafeInfered) = ptext $ sLit "safe-infered"
+ ppr (TrustInfo Sf_None) = ptext $ sLit "none"
+ ppr (TrustInfo Sf_Unsafe) = ptext $ sLit "unsafe"
+ ppr (TrustInfo Sf_Trustworthy) = ptext $ sLit "trustworthy"
+ ppr (TrustInfo Sf_Safe) = ptext $ sLit "safe"
+ ppr (TrustInfo Sf_SafeInferred) = ptext $ sLit "safe-inferred"
\end{code}
%************************************************************************
diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs
index e835ad0a70..2c8d69e2f6 100644
--- a/compiler/typecheck/TcRnTypes.lhs
+++ b/compiler/typecheck/TcRnTypes.lhs
@@ -323,8 +323,9 @@ data TcGblEnv
tcg_main :: Maybe Name, -- ^ The Name of the main
-- function, if this module is
-- the main module.
- tcg_safeInfer :: TcRef Bool -- Has the typechecker infered this
- -- module as -XSafe (Safe Haskell)
+ tcg_safeInfer :: TcRef Bool -- Has the typechecker
+ -- inferred this module
+ -- as -XSafe (Safe Haskell)
}
data RecFieldEnv
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 7e83565b1a..01fb45a879 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -1472,7 +1472,7 @@ isSafeModule m = do
False -> liftIO $ putStrLn $ mname ++ " is NOT trusted!"
where
- goodTrust t = t `elem` [Sf_Safe, Sf_SafeInfered, Sf_Trustworthy]
+ goodTrust t = t `elem` [Sf_Safe, Sf_SafeInferred, Sf_Trustworthy]
mname = GHC.moduleNameString $ GHC.moduleName m