summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2011-06-29 17:40:49 -0700
committerDavid Terei <davidterei@gmail.com>2011-06-29 17:42:20 -0700
commitfe7eac515ae2d072aec4b4e7a576841b27540114 (patch)
tree534ac8b9fbed75452a81cdd30a5dc2df02e90e24
parente2ce80dc692a5f62a8e5ac2000bf80037bbab95f (diff)
downloadhaskell-fe7eac515ae2d072aec4b4e7a576841b27540114.tar.gz
SafeHaskell: Try to be consistent in naming.
-rw-r--r--compiler/iface/MkIface.lhs6
-rw-r--r--compiler/main/CmdLineParser.hs6
-rw-r--r--compiler/main/DynFlags.hs22
-rw-r--r--compiler/main/HscMain.lhs2
-rw-r--r--compiler/rename/RnNames.lhs6
-rw-r--r--compiler/typecheck/TcErrors.lhs2
-rw-r--r--compiler/types/InstEnv.lhs4
-rw-r--r--ghc/InteractiveUI.hs2
8 files changed, 25 insertions, 25 deletions
diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs
index 8943bd9f79..95cf35e427 100644
--- a/compiler/iface/MkIface.lhs
+++ b/compiler/iface/MkIface.lhs
@@ -533,9 +533,7 @@ addFingerprints hsc_env mb_old_fingerprint iface0 new_decls
-- dep_pkgs: see "Package Version Changes" on
-- wiki/Commentary/Compiler/RecompilationAvoidance
mi_trust iface0)
- -- TODO: Can probably make more fine grained. Only
- -- really need to have recompilation for overlapping
- -- instances.
+ -- Make sure change of Safe Haskell mode causes recomp.
-- put the declarations in a canonical order, sorted by OccName
let sorted_decls = Map.elems $ Map.fromList $
@@ -924,7 +922,7 @@ mk_usage_info pit hsc_env this_mod direct_imports used_names
Just _ -> pprPanic "mkUsage: empty direct import" empty
Nothing -> (False, safeImplicitImpsReq dflags)
-- Nothing case is for implicit imports like 'System.IO' when 'putStrLn'
- -- is used in the source code. We require them to be safe in SafeHaskell
+ -- is used in the source code. We require them to be safe in Safe Haskell
used_occs = lookupModuleEnv ent_map mod `orElse` []
diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs
index 3ff75e1043..02b6042148 100644
--- a/compiler/main/CmdLineParser.hs
+++ b/compiler/main/CmdLineParser.hs
@@ -34,11 +34,11 @@ import Data.List
data Flag m = Flag
{ flagName :: String, -- Flag, without the leading "-"
- flagSafety :: FlagSafety, -- Flag safety level (SafeHaskell)
+ flagSafety :: FlagSafety, -- Flag safety level (Safe Haskell)
flagOptKind :: OptKind m -- What to do if we see it
}
--- | This determines how a flag should behave when SafeHaskell
+-- | This determines how a flag should behave when Safe Haskell
-- mode is on.
data FlagSafety
= EnablesSafe -- ^ This flag is a little bit of a hack. We give
@@ -107,7 +107,7 @@ setArg l s (EwM f) = EwM (\_ _ c es ws ->
| otherwise = err l es ws
err (L loc ('-' : arg)) es ws =
let msg = "Warning: " ++ arg ++ " is not allowed in "
- ++ "SafeHaskell; ignoring " ++ arg
+ ++ "Safe Haskell; ignoring " ++ arg
in return (es, ws `snocBag` L loc msg, ())
err _ _ _ = error "Bad pattern match in setArg"
in check)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index afb1d8739d..9f53666d78 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -32,11 +32,12 @@ module DynFlags (
DPHBackend(..), dphPackageMaybe,
wayNames,
- -- ** SafeHaskell
+ -- ** Safe Haskell
SafeHaskellMode(..),
safeHaskellOn, safeLanguageOn,
safeDirectImpsReq, safeImplicitImpsReq,
+ -- ** System tool settings and locations
Settings(..),
ghcUsagePath, ghciUsagePath, topDir, tmpDir, rawSettings,
extraGccViaCFlags, systemPackageConfig,
@@ -325,7 +326,7 @@ data DynFlag
data Language = Haskell98 | Haskell2010
--- | The various SafeHaskell modes
+-- | The various Safe Haskell modes
data SafeHaskellMode
= Sf_None
| Sf_SafeImports
@@ -979,17 +980,18 @@ setLanguage l = upd f
extensionFlags = flattenExtensionFlags mLang oneoffs
}
+-- | Is the Safe Haskell safe language in use
safeLanguageOn :: DynFlags -> Bool
safeLanguageOn dflags = s == Sf_SafeLanguage
|| s == Sf_TrustworthyWithSafeLanguage
|| s == Sf_Safe
where s = safeHaskell dflags
--- | Test if SafeHaskell is on in some form
+-- | Test if Safe Haskell is on in some form
safeHaskellOn :: DynFlags -> Bool
safeHaskellOn dflags = safeHaskell dflags /= Sf_None
--- | Set a 'SafeHaskell' flag
+-- | Set a 'Safe Haskell' flag
setSafeHaskell :: SafeHaskellMode -> DynP ()
setSafeHaskell s = updM f
where f dfs = do
@@ -997,18 +999,18 @@ setSafeHaskell s = updM f
safeM <- combineSafeFlags sf s
return $ dfs { safeHaskell = safeM }
--- | Are all direct imports required to be safe for this SafeHaskell mode?
+-- | Are all direct imports required to be safe for this Safe Haskell mode?
-- Direct imports are when the code explicitly imports a module
safeDirectImpsReq :: DynFlags -> Bool
safeDirectImpsReq = safeLanguageOn
--- | Are all implicit imports required to be safe for this SafeHaskell mode?
+-- | Are all implicit imports required to be safe for this Safe Haskell mode?
-- Implicit imports are things in the prelude. e.g System.IO when print is used.
safeImplicitImpsReq :: DynFlags -> Bool
safeImplicitImpsReq = safeLanguageOn
--- | Combine two SafeHaskell modes correctly. Used for dealing with multiple flags.
--- This makes SafeHaskell very much a monoid but for now I prefer this as I don't
+-- | Combine two Safe Haskell modes correctly. Used for dealing with multiple flags.
+-- This makes Safe Haskell very much a monoid but for now I prefer this as I don't
-- want to export this functionality from the module but do want to export the
-- type constructors.
combineSafeFlags :: SafeHaskellMode -> SafeHaskellMode -> DynP SafeHaskellMode
@@ -1038,7 +1040,7 @@ combineSafeFlags a b =
| otherwise -> err
where err = do
- let s = "Incompatible SafeHaskell flags! (" ++ showPpr a ++ ", " ++ showPpr b ++ ")"
+ let s = "Incompatible Safe Haskell flags! (" ++ showPpr a ++ ", " ++ showPpr b ++ ")"
addErr s
return $ panic s -- Just for saftey instead of returning say, a
@@ -1271,7 +1273,7 @@ shFlagsDisallowed dflags = foldl check_method (dflags, []) bad_flags
flip xopt_unset Opt_TemplateHaskell)]
safeFailure str = [L noSrcSpan $ "Warning: " ++ str ++ " is not allowed in"
- ++ " SafeHaskell; ignoring " ++ str]
+ ++ " Safe Haskell; ignoring " ++ str]
{- **********************************************************************
diff --git a/compiler/main/HscMain.lhs b/compiler/main/HscMain.lhs
index 690bf1160b..17bd230421 100644
--- a/compiler/main/HscMain.lhs
+++ b/compiler/main/HscMain.lhs
@@ -778,7 +778,7 @@ hscFileFrontEnd mod_summary = do
ioMsgMaybe $
tcRnModule hsc_env (ms_hsc_src mod_summary) False rdr_module
dflags <- getDynFlags
- -- XXX: See Note [SafeHaskell API]
+ -- XXX: See Note [Safe Haskell API]
if safeHaskellOn dflags
then do
tcg_env1 <- checkSafeImports dflags hsc_env tcg_env
diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs
index 4911015428..afec7f59b5 100644
--- a/compiler/rename/RnNames.lhs
+++ b/compiler/rename/RnNames.lhs
@@ -113,7 +113,7 @@ requirements from B? Should A now also require that a package p is trusted since
B required it?
We currently say no but I saying yes also makes sense. The difference is, if a
-module M that doesn't use SafeHaskell imports a module N that does, should all
+module M that doesn't use Safe Haskell imports a module N that does, should all
the trusted package requirements be dropped since M didn't declare that it cares
about Safe Haskell (so -XSafe is more strongly associated with the module doing
the importing) or should it be done still since the author of the module N that
@@ -121,8 +121,8 @@ uses Safe Haskell said they cared (so -XSafe is more strongly associated with
the module that was compiled that used it).
Going with yes is a simpler semantics we think and harder for the user to stuff
-up but it does mean that SafeHaskell will affect users who don't care about
-SafeHaskell as they might grab a package from Cabal which uses safe haskell (say
+up but it does mean that Safe Haskell will affect users who don't care about
+Safe Haskell as they might grab a package from Cabal which uses safe haskell (say
network) and that packages imports -XTrustworthy modules from another package
(say bytestring), so requires that package is trusted. The user may now get
compilation errors in code that doesn't do anything with Safe Haskell simply
diff --git a/compiler/typecheck/TcErrors.lhs b/compiler/typecheck/TcErrors.lhs
index 31bd7214fd..d298a10f19 100644
--- a/compiler/typecheck/TcErrors.lhs
+++ b/compiler/typecheck/TcErrors.lhs
@@ -621,7 +621,7 @@ reportOverlap ctxt inst_envs orig pred@(ClassP clas tys)
any ev_var_matches (immSuperClasses clas' tys')
ev_var_matches _ = False
- -- Overlap error because of SafeHaskell (first match should be the most
+ -- Overlap error because of Safe Haskell (first match should be the most
-- specific match)
mk_overlap_msg (matches, _unifiers, True)
= ASSERT( length matches > 1 )
diff --git a/compiler/types/InstEnv.lhs b/compiler/types/InstEnv.lhs
index db310f3c7f..2789a331cc 100644
--- a/compiler/types/InstEnv.lhs
+++ b/compiler/types/InstEnv.lhs
@@ -432,7 +432,7 @@ lookupInstEnv :: (InstEnv, InstEnv) -- External and home package inst-env
-> ([InstMatch], -- Successful matches
[Instance], -- These don't match but do unify
Bool) -- True if error condition caused by
- -- SafeHaskell condition.
+ -- Safe Haskell condition.
-- The second component of the result pair happens when we look up
-- Foo [a]
@@ -462,7 +462,7 @@ lookupInstEnv (pkg_ie, home_ie) cls tys
-- misleading (complaining of multiple matches when some should be
-- overlapped away)
- -- SafeHaskell: We restrict code compiled in 'Safe' mode from
+ -- Safe Haskell: We restrict code compiled in 'Safe' mode from
-- overriding code compiled in any other mode. The rational is
-- that code compiled in 'Safe' mode is code that is untrusted
-- by the ghc user. So we shouldn't let that code change the
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 981abdfe79..139c2b462e 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -1322,7 +1322,7 @@ runScript filename = do
else return ()
-----------------------------------------------------------------------------
--- Displaying SafeHaskell properties of a module
+-- Displaying Safe Haskell properties of a module
isSafeCmd :: String -> InputT GHCi ()
isSafeCmd m =