diff options
-rw-r--r-- | compiler/coreSyn/CoreUtils.hs | 2 | ||||
-rw-r--r-- | compiler/deSugar/DsMonad.hs | 2 | ||||
-rw-r--r-- | compiler/simplCore/FloatOut.hs | 4 | ||||
-rw-r--r-- | compiler/simplCore/OccurAnal.hs | 2 | ||||
-rw-r--r-- | compiler/simplCore/SetLevels.hs | 12 | ||||
-rw-r--r-- | compiler/simplCore/SimplUtils.hs | 4 | ||||
-rw-r--r-- | compiler/specialise/Specialise.hs | 10 | ||||
-rw-r--r-- | compiler/stranal/WwLib.hs | 4 | ||||
-rw-r--r-- | compiler/typecheck/TcCanonical.hs | 2 | ||||
-rw-r--r-- | compiler/utils/Pretty.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/pragma001.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/driver/pragma002.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T3018.hs | 10 |
13 files changed, 29 insertions, 31 deletions
diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 348179d460..9c425e72f0 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -1752,7 +1752,7 @@ Moreover we really might float (f (dataToTag# x)) outside the case, and then it really, really doesn't obey the let/app invariant. The solution is simple: exprOkForSpeculation does not try to take -advantage of the evaluated-ness of (lifted) varaibles. And it returns +advantage of the evaluated-ness of (lifted) variables. And it returns False (always) for DataToTagOp and SeqOp. Note that exprIsHNF /can/ and does take advantage of evaluated-ness; diff --git a/compiler/deSugar/DsMonad.hs b/compiler/deSugar/DsMonad.hs index 7742f8cd76..f328322e68 100644 --- a/compiler/deSugar/DsMonad.hs +++ b/compiler/deSugar/DsMonad.hs @@ -541,7 +541,7 @@ dsGetFamInstEnvs dsGetMetaEnv :: DsM (NameEnv DsMetaVal) dsGetMetaEnv = do { env <- getLclEnv; return (dsl_meta env) } --- | The @COMPLETE@ pragams provided by the user for a given `TyCon`. +-- | The @COMPLETE@ pragmas provided by the user for a given `TyCon`. dsGetCompleteMatches :: TyCon -> DsM [CompleteMatch] dsGetCompleteMatches tc = do eps <- getEps diff --git a/compiler/simplCore/FloatOut.hs b/compiler/simplCore/FloatOut.hs index 6cb21f9470..0be1a9e0ad 100644 --- a/compiler/simplCore/FloatOut.hs +++ b/compiler/simplCore/FloatOut.hs @@ -47,7 +47,7 @@ The Big Main Idea is: a non-one-shot value lambda, and hence may be shared. -To achieve this we may need to do two thing: +To achieve this we may need to do two things: a) Let-bind the sub-expression: @@ -103,7 +103,7 @@ It turns out that this generates a subexpression of the form @ \deq x ys -> let eq = eqFromEqDict deq in ... @ -vwhich might usefully be separated to +which might usefully be separated to @ \deq -> let eq = eqFromEqDict deq in \xy -> ... @ diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs index 2cc38a27e0..8b16422960 100644 --- a/compiler/simplCore/OccurAnal.hs +++ b/compiler/simplCore/OccurAnal.hs @@ -1307,7 +1307,7 @@ nodeScore env old_bndr new_bndr bind_rhs lb_deps = (0, 0, True) -- See Note [Self-recursion and loop breakers] | not (occ_unf_act env old_bndr) -- A binder whose inlining is inactive (e.g. has - = (0, 0, True) -- a NOINLINE pragam) makes a great loop breaker + = (0, 0, True) -- a NOINLINE pragma) makes a great loop breaker | exprIsTrivial rhs = mk_score 10 -- Practically certain to be inlined diff --git a/compiler/simplCore/SetLevels.hs b/compiler/simplCore/SetLevels.hs index c3802bec71..e685b3a65a 100644 --- a/compiler/simplCore/SetLevels.hs +++ b/compiler/simplCore/SetLevels.hs @@ -167,7 +167,7 @@ out at all. See notes with lvlMFE below. But, check this out: --- At one time I tried the effect of not float anything out of an InlineMe, +-- At one time I tried the effect of not floating anything out of an InlineMe, -- but it sometimes works badly. For example, consider PrelArr.done. It -- has the form __inline (\d. e) -- where e doesn't mention d. If we float this to @@ -366,7 +366,7 @@ lvlExpr env expr@(_, AnnLam {}) (bndrs, body) = collectAnnBndrs expr (env1, bndrs1) = substBndrsSL NonRecursive env bndrs (new_env, new_bndrs) = lvlLamBndrs env1 (le_ctxt_lvl env) bndrs1 - -- At one time we called a special verion of collectBinders, + -- At one time we called a special version of collectBinders, -- which ignored coercions, because we don't want to split -- a lambda like this (\x -> coerce t (\s -> ...)) -- This used to happen quite a bit in state-transformer programs, @@ -517,7 +517,7 @@ Things to note: - exrpIsHNF catches the key case of an evaluated variable - - exprOkForSpeculaion is /false/ of an evaluated varaible; + - exprOkForSpeculation is /false/ of an evaluated variable; See Note [exprOkForSpeculation and evaluated variables] in CoreUtils So we'd actually miss the key case! @@ -1117,7 +1117,7 @@ lvlBind env (AnnRec pairs) -- this, allocation rises significantly on some programs -- -- We could elaborate it for the case where there are several - -- mutually functions, but it's quite a bit more complicated + -- mutually recursive functions, but it's quite a bit more complicated -- -- This all seems a bit ad hoc -- sigh let (rhs_env, abs_vars_w_lvls) = lvlLamBndrs env dest_lvl abs_vars @@ -1226,7 +1226,7 @@ lvlFloatRhs abs_vars dest_lvl env rec is_bot mb_join_arity rhs {- Note [Floating from a RHS] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When float the RHS of a let-binding, we don't always want to apply +When floating the RHS of a let-binding, we don't always want to apply lvlMFE to the body of a lambda, as we usually do, because the entire binding body is already going to the right place (dest_lvl). @@ -1696,7 +1696,7 @@ cloneLetVars is_rec | otherwise = v zap_join | isTopLvl dest_lvl = zapJoinId - | otherwise = \v -> v + | otherwise = id add_id :: IdEnv ([Var], LevelledExpr) -> (Var, Var) -> IdEnv ([Var], LevelledExpr) add_id id_env (v, v1) diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index d4726abf59..4c59bbaa8b 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -1112,8 +1112,8 @@ want PreInlineUnconditionally to second-guess it. A live example is Trac #3736. c.f. Note [Stable unfoldings and postInlineUnconditionally] -NB: if the pragama is INLINEABLE, then we don't want to behave int -this special way -- an INLINEABLE pragam just says to GHC "inline this +NB: if the pragma is INLINEABLE, then we don't want to behave in +this special way -- an INLINEABLE pragma just says to GHC "inline this if you like". But if there is a unique occurrence, we want to inline the stable unfolding, not the RHS. diff --git a/compiler/specialise/Specialise.hs b/compiler/specialise/Specialise.hs index 67e57c877b..d5e64e3dc0 100644 --- a/compiler/specialise/Specialise.hs +++ b/compiler/specialise/Specialise.hs @@ -940,7 +940,7 @@ specCase env scrut' case_bndr [(con, args, rhs)] | sc_arg' <- sc_args' ] -- Extend the substitution for RHS to map the *original* binders - -- to their floated verions. + -- to their floated versions. mb_sc_flts :: [Maybe DictId] mb_sc_flts = map (lookupVarEnv clone_env) args' clone_env = zipVarEnv sc_args' sc_args_flt @@ -1721,7 +1721,7 @@ This doesn't always work. One example I came across was this: oneof = choose (1::Int) -It's a silly exapmle, but we get +It's a silly example, but we get choose = /\a. g `cast` co where choose doesn't have any dict arguments. Thus far I have not tried to fix this (wait till there's a real example). @@ -2176,9 +2176,9 @@ dumpUDs bndrs uds@(MkUD { ud_binds = orig_dbs, ud_calls = orig_calls }) dumpBindUDs :: [CoreBndr] -> UsageDetails -> (UsageDetails, Bag DictBind, Bool) -- Used at a let(rec) binding. --- We return a boolean indicating whether the binding itself is mentioned --- is mentioned, directly or indirectly, by any of the ud_calls; in that --- case we want to float the binding itself; +-- We return a boolean indicating whether the binding itself is mentioned, +-- directly or indirectly, by any of the ud_calls; in that case we want to +-- float the binding itself; -- See Note [Floated dictionary bindings] dumpBindUDs bndrs (MkUD { ud_binds = orig_dbs, ud_calls = orig_calls }) = -- pprTrace "dumpBindUDs" (ppr bndrs $$ ppr free_uds $$ ppr dump_dbs) $ diff --git a/compiler/stranal/WwLib.hs b/compiler/stranal/WwLib.hs index 902adbfd90..756a706dd8 100644 --- a/compiler/stranal/WwLib.hs +++ b/compiler/stranal/WwLib.hs @@ -506,7 +506,7 @@ To avoid this: mkWWstr :: DynFlags -> FamInstEnvs - -> Bool -- True <=> INLINEABLE pragama on this function defn + -> Bool -- True <=> INLINEABLE pragma on this function defn -- See Note [Do not unpack class dictionaries] -> [Var] -- Wrapper args; have their demand info on them -- *Includes type variables* @@ -569,7 +569,7 @@ as-yet-un-filled-in pkgState files. -- brings into scope wrap_arg (via lets) -- See Note [How to do the worker/wrapper split] mkWWstr_one :: DynFlags -> FamInstEnvs - -> Bool -- True <=> INLINEABLE pragama on this function defn + -> Bool -- True <=> INLINEABLE pragma on this function defn -- See Note [Do not unpack class dictionaries] -> Var -> UniqSM (Bool, [Var], CoreExpr -> CoreExpr, CoreExpr -> CoreExpr) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index dce9a10aff..a1451a83bc 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -1185,7 +1185,7 @@ zonk_eq_types = go ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider newtype N m a = MkN (m a) -Then N will get a conservative, Nominal role for its second paramter 'a', +Then N will get a conservative, Nominal role for its second parameter 'a', because it appears as an argument to the unknown 'm'. Now consider [W] N Maybe a ~R# N Maybe b diff --git a/compiler/utils/Pretty.hs b/compiler/utils/Pretty.hs index 32b982855a..7d06d74016 100644 --- a/compiler/utils/Pretty.hs +++ b/compiler/utils/Pretty.hs @@ -189,7 +189,7 @@ Laws for oneLiner <o1> oneLiner (nest k p) = nest k (oneLiner p) <o2> oneLiner (x <> y) = oneLiner x <> oneLiner y -You might think that the following verion of <m1> would +You might think that the following version of <m1> would be neater: <3 NO> (text s <> x) $$ y = text s <> ((empty <> x)) $$ diff --git a/testsuite/tests/driver/pragma001.hs b/testsuite/tests/driver/pragma001.hs index 8c1b7aac94..4e89ea94b1 100644 --- a/testsuite/tests/driver/pragma001.hs +++ b/testsuite/tests/driver/pragma001.hs @@ -23,7 +23,6 @@ module Pragma001 () where --- This will make a warning if the pragam isn't picked up +-- This will make a warning if the pragma isn't picked up foo _ = () foo _ = () - diff --git a/testsuite/tests/driver/pragma002.hs b/testsuite/tests/driver/pragma002.hs index 48c66101bc..8f2b03b7ba 100644 --- a/testsuite/tests/driver/pragma002.hs +++ b/testsuite/tests/driver/pragma002.hs @@ -4,7 +4,6 @@ module Pragma002 () where --- This will make a warning if the pragam isn't picked up +-- This will make a warning if the pragma isn't picked up foo _ = () foo _ = () - diff --git a/testsuite/tests/typecheck/should_compile/T3018.hs b/testsuite/tests/typecheck/should_compile/T3018.hs index bf178e0898..f584f1bacc 100644 --- a/testsuite/tests/typecheck/should_compile/T3018.hs +++ b/testsuite/tests/typecheck/should_compile/T3018.hs @@ -11,7 +11,7 @@ import Control.Monad -- minimal Data/Rep classes data Rep (ctx :: * -> *) a -class Data (ctx :: * -> *) a where rep :: Rep ctx a +class Data (ctx :: * -> *) a where rep :: Rep ctx a class Sat a where dict :: a @@ -23,7 +23,7 @@ class Subst_A a t t' where data SubstD_A a t t' = SubstD_A {substD_A:: forall m. (Monad m) => a -> t -> t' -> m t'} --- Allow override dictionary verion with implementation of type class Subst +-- Allow override dictionary version with implementation of type class Subst instance Subst_A a t t' => Sat (SubstD_A a t t') where dict = SubstD_A {substD_A = subst_A} @@ -39,7 +39,7 @@ class Subst_B a t t' where data SubstD_B a t t' = SubstD_B {substD_B :: a -> t -> t' -> t'} --- allow override dictionary verion with implementation of type class Subst +-- allow override dictionary version with implementation of type class Subst instance Subst_B a t t' => Sat (SubstD_B a t t') where dict = SubstD_B {substD_B = subst_B} @@ -55,7 +55,7 @@ Here are the key lines of code: class Subst a t t' where subst :: (Monad m) => a -> t -> t' -> m t' - data SubstD a t t' + data SubstD a t t' = SubstD (forall m. Monad m => a -> t -> t' -> m t') instance Data (SubstD a t) t' => Subst a t t' -- (1) @@ -67,7 +67,7 @@ The call to 'subst' on the last line gives rise to a constraint (Subst a t t'). But that constraint can be satisfied in two different ways: Using the instance declaration for Subst (which matches anything!) - Using the context of the Sat (SubstD ..) instance declaration itself + Using the context of the Sat (SubstD ..) instance declaration itself If GHC uses (1) it gets into a corner it can't get out of, because now it needs (Data (SubstD a t) t'), and that it can't get. The error |