Commit 3e1745aa authored by Gabor Greif's avatar Gabor Greif 💬

typos

parent a217e7a2
...@@ -291,7 +291,7 @@ mkDictSelId dflags no_unf name clas ...@@ -291,7 +291,7 @@ mkDictSelId dflags no_unf name clas
else mkImplicitUnfolding dflags rhs) else mkImplicitUnfolding dflags rhs)
-- In module where class op is defined, we must add -- In module where class op is defined, we must add
-- the unfolding, even though it'll never be inlined -- the unfolding, even though it'll never be inlined
-- becuase we use that to generate a top-level binding -- because we use that to generate a top-level binding
-- for the ClassOp -- for the ClassOp
info | new_tycon = base_info `setInlinePragInfo` alwaysInlinePragma info | new_tycon = base_info `setInlinePragInfo` alwaysInlinePragma
......
...@@ -257,7 +257,7 @@ data RealSrcSpan ...@@ -257,7 +257,7 @@ data RealSrcSpan
srcSpanLine :: {-# UNPACK #-} !Int, srcSpanLine :: {-# UNPACK #-} !Int,
srcSpanCol :: {-# UNPACK #-} !Int srcSpanCol :: {-# UNPACK #-} !Int
} }
deriving (Eq, Typeable, Show) -- Show is used by Lexer.x, becuase we deriving (Eq, Typeable, Show) -- Show is used by Lexer.x, because we
-- derive Show for Token -- derive Show for Token
data SrcSpan = data SrcSpan =
...@@ -265,7 +265,7 @@ data SrcSpan = ...@@ -265,7 +265,7 @@ data SrcSpan =
| UnhelpfulSpan !FastString -- Just a general indication | UnhelpfulSpan !FastString -- Just a general indication
-- also used to indicate an empty span -- also used to indicate an empty span
deriving (Eq, Typeable, Show) -- Show is used by Lexer.x, becuase we deriving (Eq, Typeable, Show) -- Show is used by Lexer.x, because we
-- derive Show for Token -- derive Show for Token
-- | Built-in "bad" 'SrcSpan's for common sources of location uncertainty -- | Built-in "bad" 'SrcSpan's for common sources of location uncertainty
......
...@@ -352,7 +352,7 @@ idDetails (Id { id_details = details }) = details ...@@ -352,7 +352,7 @@ idDetails (Id { id_details = details }) = details
idDetails other = pprPanic "idDetails" (ppr other) idDetails other = pprPanic "idDetails" (ppr other)
-- The next three have a 'Var' suffix even though they always build -- The next three have a 'Var' suffix even though they always build
-- Ids, becuase Id.lhs uses 'mkGlobalId' etc with different types -- Ids, because Id.lhs uses 'mkGlobalId' etc with different types
mkGlobalVar :: IdDetails -> Name -> Type -> IdInfo -> Id mkGlobalVar :: IdDetails -> Name -> Type -> IdInfo -> Id
mkGlobalVar details name ty info mkGlobalVar details name ty info
= mk_id name ty GlobalId details info = mk_id name ty GlobalId details info
......
...@@ -202,7 +202,7 @@ slightly more complicated, does) turn into ...@@ -202,7 +202,7 @@ slightly more complicated, does) turn into
blah = op (\eta. ($dfList dCInt |> sym co) eta) blah = op (\eta. ($dfList dCInt |> sym co) eta)
and now it is *much* harder for the op/$dfList rule to fire, becuase and now it is *much* harder for the op/$dfList rule to fire, because
exprIsConApp_maybe won't hold of the argument to op. I considered exprIsConApp_maybe won't hold of the argument to op. I considered
trying to *make* it hold, but it's tricky and I gave up. trying to *make* it hold, but it's tricky and I gave up.
......
...@@ -144,7 +144,7 @@ lintCoreBindings binds ...@@ -144,7 +144,7 @@ lintCoreBindings binds
-- allow this at top level: -- allow this at top level:
-- M.n{r3} = ... -- M.n{r3} = ...
-- M.n{r29} = ... -- M.n{r29} = ...
-- becuase they both get the same linker symbol -- because they both get the same linker symbol
ext_dups = snd (removeDups ord_ext (map Var.varName binders)) ext_dups = snd (removeDups ord_ext (map Var.varName binders))
ord_ext n1 n2 | Just m1 <- nameModule_maybe n1 ord_ext n1 n2 | Just m1 <- nameModule_maybe n1
, Just m2 <- nameModule_maybe n2 , Just m2 <- nameModule_maybe n2
......
...@@ -436,7 +436,7 @@ substBind subst (Rec pairs) = (subst', Rec (bndrs' `zip` rhss')) ...@@ -436,7 +436,7 @@ substBind subst (Rec pairs) = (subst', Rec (bndrs' `zip` rhss'))
\begin{code} \begin{code}
-- | De-shadowing the program is sometimes a useful pre-pass. It can be done simply -- | De-shadowing the program is sometimes a useful pre-pass. It can be done simply
-- by running over the bindings with an empty substitution, becuase substitution -- by running over the bindings with an empty substitution, because substitution
-- returns a result that has no-shadowing guaranteed. -- returns a result that has no-shadowing guaranteed.
-- --
-- (Actually, within a single /type/ there might still be shadowing, because -- (Actually, within a single /type/ there might still be shadowing, because
...@@ -868,7 +868,7 @@ simpleOptExpr :: CoreExpr -> CoreExpr ...@@ -868,7 +868,7 @@ simpleOptExpr :: CoreExpr -> CoreExpr
-- We also inline bindings that bind a Eq# box: see -- We also inline bindings that bind a Eq# box: see
-- See Note [Optimise coercion boxes agressively]. -- See Note [Optimise coercion boxes agressively].
-- --
-- The result is NOT guaranteed occurence-analysed, becuase -- The result is NOT guaranteed occurence-analysed, because
-- in (let x = y in ....) we substitute for x; so y's occ-info -- in (let x = y in ....) we substitute for x; so y's occ-info
-- may change radically -- may change radically
......
...@@ -525,7 +525,7 @@ There used to be a gruesome test for (hasNoBinding v) in the ...@@ -525,7 +525,7 @@ There used to be a gruesome test for (hasNoBinding v) in the
Var case: Var case:
exprIsTrivial (Var v) | hasNoBinding v = idArity v == 0 exprIsTrivial (Var v) | hasNoBinding v = idArity v == 0
The idea here is that a constructor worker, like \$wJust, is The idea here is that a constructor worker, like \$wJust, is
really short for (\x -> \$wJust x), becuase \$wJust has no binding. really short for (\x -> \$wJust x), because \$wJust has no binding.
So it should be treated like a lambda. Ditto unsaturated primops. So it should be treated like a lambda. Ditto unsaturated primops.
But now constructor workers are not "have-no-binding" Ids. And But now constructor workers are not "have-no-binding" Ids. And
completely un-applied primops and foreign-call Ids are sufficiently completely un-applied primops and foreign-call Ids are sufficiently
......
...@@ -371,7 +371,7 @@ dsRule (L loc (HsRule name act vars lhs _tv_lhs rhs _fv_rhs)) ...@@ -371,7 +371,7 @@ dsRule (L loc (HsRule name act vars lhs _tv_lhs rhs _fv_rhs))
Right (final_bndrs, fn_id, args) -> do Right (final_bndrs, fn_id, args) -> do
{ let is_local = isLocalId fn_id { let is_local = isLocalId fn_id
-- NB: isLocalId is False of implicit Ids. This is good becuase -- NB: isLocalId is False of implicit Ids. This is good because
-- we don't want to attach rules to the bindings of implicit Ids, -- we don't want to attach rules to the bindings of implicit Ids,
-- because they don't show up in the bindings until just before code gen -- because they don't show up in the bindings until just before code gen
fn_name = idName fn_id fn_name = idName fn_id
......
...@@ -662,8 +662,8 @@ It's true that this *is* a more specialised type, but the rule ...@@ -662,8 +662,8 @@ It's true that this *is* a more specialised type, but the rule
we get is something like this: we get is something like this:
f_spec d = f f_spec d = f
RULE: f = f_spec d RULE: f = f_spec d
Note that the rule is bogus, becuase it mentions a 'd' that is Note that the rule is bogus, because it mentions a 'd' that is
not bound on the LHS! But it's a silly specialisation anyway, becuase not bound on the LHS! But it's a silly specialisation anyway, because
the constraint is unused. We could bind 'd' to (error "unused") the constraint is unused. We could bind 'd' to (error "unused")
but it seems better to reject the program because it's almost certainly but it seems better to reject the program because it's almost certainly
a mistake. That's what the isDeadBinder call detects. a mistake. That's what the isDeadBinder call detects.
......
...@@ -820,7 +820,7 @@ conversionNames ...@@ -820,7 +820,7 @@ conversionNames
= [ toIntegerName, toRationalName = [ toIntegerName, toRationalName
, fromIntegralName, realToFracName ] , fromIntegralName, realToFracName ]
-- We can't easily add fromIntegerName, fromRationalName, -- We can't easily add fromIntegerName, fromRationalName,
-- becuase they are generated by literals -- because they are generated by literals
\end{code} \end{code}
%************************************************************************ %************************************************************************
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
-- CoreExpr's of the "smart constructors" of the Meta.Exp datatype. -- CoreExpr's of the "smart constructors" of the Meta.Exp datatype.
-- --
-- It also defines a bunch of knownKeyNames, in the same way as is done -- It also defines a bunch of knownKeyNames, in the same way as is done
-- in prelude/PrelNames. It's much more convenient to do it here, becuase -- in prelude/PrelNames. It's much more convenient to do it here, because
-- otherwise we have to recompile PrelNames whenever we add a Name, which is -- otherwise we have to recompile PrelNames whenever we add a Name, which is
-- a Royal Pain (triggers other recompilation). -- a Royal Pain (triggers other recompilation).
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -351,7 +351,7 @@ repClsInstD (ClsInstDecl { cid_poly_ty = ty, cid_binds = binds ...@@ -351,7 +351,7 @@ repClsInstD (ClsInstDecl { cid_poly_ty = ty, cid_binds = binds
-- appear in the resulting data structure -- appear in the resulting data structure
-- --
-- But we do NOT bring the binders of 'binds' into scope -- But we do NOT bring the binders of 'binds' into scope
-- becuase they are properly regarded as occurrences -- because they are properly regarded as occurrences
-- For example, the method names should be bound to -- For example, the method names should be bound to
-- the selector Ids, not to fresh names (Trac #5410) -- the selector Ids, not to fresh names (Trac #5410)
-- --
...@@ -1876,7 +1876,7 @@ mk_string s = return $ HsString s ...@@ -1876,7 +1876,7 @@ mk_string s = return $ HsString s
repOverloadedLiteral :: HsOverLit Name -> DsM (Core TH.Lit) repOverloadedLiteral :: HsOverLit Name -> DsM (Core TH.Lit)
repOverloadedLiteral (OverLit { ol_val = val}) repOverloadedLiteral (OverLit { ol_val = val})
= do { lit <- mk_lit val; repLiteral lit } = do { lit <- mk_lit val; repLiteral lit }
-- The type Rational will be in the environment, becuase -- The type Rational will be in the environment, because
-- the smart constructor 'TH.Syntax.rationalL' uses it in its type, -- the smart constructor 'TH.Syntax.rationalL' uses it in its type,
-- and rationalL is sucked in when any TH stuff is used -- and rationalL is sucked in when any TH stuff is used
......
...@@ -291,7 +291,7 @@ mkCoAlgCaseMatchResult dflags var ty match_alts ...@@ -291,7 +291,7 @@ mkCoAlgCaseMatchResult dflags var ty match_alts
= MatchResult fail_flag mk_case = MatchResult fail_flag mk_case
where where
tycon = dataConTyCon con1 tycon = dataConTyCon con1
-- [Interesting: becuase of GADTs, we can't rely on the type of -- [Interesting: because of GADTs, we can't rely on the type of
-- the scrutinised Id to be sufficiently refined to have a TyCon in it] -- the scrutinised Id to be sufficiently refined to have a TyCon in it]
-- Stuff for newtype -- Stuff for newtype
......
...@@ -113,7 +113,7 @@ dsOverLit' dflags (OverLit { ol_val = val, ol_rebindable = rebindable ...@@ -113,7 +113,7 @@ dsOverLit' dflags (OverLit { ol_val = val, ol_rebindable = rebindable
Note [Literal short cut] Note [Literal short cut]
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
The type checker tries to do this short-cutting as early as possible, but The type checker tries to do this short-cutting as early as possible, but
becuase of unification etc, more information is available to the desugarer. because of unification etc, more information is available to the desugarer.
And where it's possible to generate the correct literal right away, it's And where it's possible to generate the correct literal right away, it's
much better do do so. much better do do so.
......
...@@ -206,7 +206,7 @@ type IfaceAnnTarget = AnnTarget OccName ...@@ -206,7 +206,7 @@ type IfaceAnnTarget = AnnTarget OccName
-- We only serialise the IdDetails of top-level Ids, and even then -- We only serialise the IdDetails of top-level Ids, and even then
-- we only need a very limited selection. Notably, none of the -- we only need a very limited selection. Notably, none of the
-- implicit ones are needed here, becuase they are not put it -- implicit ones are needed here, because they are not put it
-- interface files -- interface files
data IfaceIdDetails data IfaceIdDetails
......
...@@ -476,7 +476,7 @@ Note [Don't attempt to trim data types] ...@@ -476,7 +476,7 @@ Note [Don't attempt to trim data types]
For some time GHC tried to avoid exporting the data constructors For some time GHC tried to avoid exporting the data constructors
of a data type if it wasn't strictly necessary to do so; see Trac #835. of a data type if it wasn't strictly necessary to do so; see Trac #835.
But "strictly necessary" accumulated a longer and longer list But "strictly necessary" accumulated a longer and longer list
of execeptions, and finally I gave up the battle: of exceptions, and finally I gave up the battle:
commit 9a20e540754fc2af74c2e7392f2786a81d8d5f11 commit 9a20e540754fc2af74c2e7392f2786a81d8d5f11
Author: Simon Peyton Jones <simonpj@microsoft.com> Author: Simon Peyton Jones <simonpj@microsoft.com>
...@@ -525,7 +525,7 @@ Id still makes sense.] ...@@ -525,7 +525,7 @@ Id still makes sense.]
At one time I tried injecting the implicit bindings *early*, at the At one time I tried injecting the implicit bindings *early*, at the
beginning of SimplCore. But that gave rise to real difficulty, beginning of SimplCore. But that gave rise to real difficulty,
becuase GlobalIds are supposed to have *fixed* IdInfo, but the because GlobalIds are supposed to have *fixed* IdInfo, but the
simplifier and other core-to-core passes mess with IdInfo all the simplifier and other core-to-core passes mess with IdInfo all the
time. The straw that broke the camels back was when a class selector time. The straw that broke the camels back was when a class selector
got the wrong arity -- ie the simplifier gave it arity 2, whereas got the wrong arity -- ie the simplifier gave it arity 2, whereas
......
...@@ -749,7 +749,7 @@ getRegister' _ is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps ...@@ -749,7 +749,7 @@ getRegister' _ is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps
* so we can either: * so we can either:
- do y first, put its result in a fresh tmp, then copy it to %ecx later - do y first, put its result in a fresh tmp, then copy it to %ecx later
- do y second and put its result into %ecx. x gets placed in a fresh - do y second and put its result into %ecx. x gets placed in a fresh
tmp. This is likely to be better, becuase the reg alloc can tmp. This is likely to be better, because the reg alloc can
eliminate this reg->reg move here (it won't eliminate the other one, eliminate this reg->reg move here (it won't eliminate the other one,
because the move is into the fixed %ecx). because the move is into the fixed %ecx).
-} -}
......
...@@ -241,7 +241,7 @@ funTyCon = mkFunTyCon funTyConName $ ...@@ -241,7 +241,7 @@ funTyCon = mkFunTyCon funTyConName $
-- You might think that (->) should have type (?? -> ? -> *), and you'd be right -- You might think that (->) should have type (?? -> ? -> *), and you'd be right
-- But if we do that we get kind errors when saying -- But if we do that we get kind errors when saying
-- instance Control.Arrow (->) -- instance Control.Arrow (->)
-- becuase the expected kind is (*->*->*). The trouble is that the -- because the expected kind is (*->*->*). The trouble is that the
-- expected/actual stuff in the unifier does not go contra-variant, whereas -- expected/actual stuff in the unifier does not go contra-variant, whereas
-- the kind sub-typing does. Sigh. It really only matters if you use (->) in -- the kind sub-typing does. Sigh. It really only matters if you use (->) in
-- a prefix way, thus: (->) Int# Int#. And this is unusual. -- a prefix way, thus: (->) Int# Int#. And this is unusual.
...@@ -653,7 +653,7 @@ The type constructor Any of kind forall k. k -> k has these properties: ...@@ -653,7 +653,7 @@ The type constructor Any of kind forall k. k -> k has these properties:
* It is a *closed* type family, with no instances. This means that * It is a *closed* type family, with no instances. This means that
if ty :: '(k1, k2) we add a given coercion if ty :: '(k1, k2) we add a given coercion
g :: ty ~ (Fst ty, Snd ty) g :: ty ~ (Fst ty, Snd ty)
If Any was a *data* type, then we'd get inconsistency becuase 'ty' If Any was a *data* type, then we'd get inconsistency because 'ty'
could be (Any '(k1,k2)) and then we'd have an equality with Any on could be (Any '(k1,k2)) and then we'd have an equality with Any on
one side and '(,) on the other one side and '(,) on the other
......
...@@ -440,7 +440,7 @@ Thus: ...@@ -440,7 +440,7 @@ Thus:
instance C S where instance C S where
data G S = Y1 | Y2 data G S = Y1 | Y2
Even though there are two G's in scope (M.G and Blib.G), the occurence Even though there are two G's in scope (M.G and Blib.G), the occurence
of 'G' in the 'instance C S' decl is unambiguous, becuase C has only of 'G' in the 'instance C S' decl is unambiguous, because C has only
one associated type called G. This is exactly what happens for methods, one associated type called G. This is exactly what happens for methods,
and it is only consistent to do the same thing for types. That's the and it is only consistent to do the same thing for types. That's the
role of the function lookupTcdName; the (Maybe Name) give the class of role of the function lookupTcdName; the (Maybe Name) give the class of
......
...@@ -1056,7 +1056,7 @@ rn_rec_stmt _ all_bndrs (L loc (LetStmt (HsValBinds binds'))) _ = do ...@@ -1056,7 +1056,7 @@ rn_rec_stmt _ all_bndrs (L loc (LetStmt (HsValBinds binds'))) _ = do
return [(duDefs du_binds, allUses du_binds, return [(duDefs du_binds, allUses du_binds,
emptyNameSet, L loc (LetStmt (HsValBinds binds')))] emptyNameSet, L loc (LetStmt (HsValBinds binds')))]
-- no RecStmt case becuase they get flattened above when doing the LHSes -- no RecStmt case because they get flattened above when doing the LHSes
rn_rec_stmt _ _ stmt@(L _ (RecStmt {})) _ rn_rec_stmt _ _ stmt@(L _ (RecStmt {})) _
= pprPanic "rn_rec_stmt: RecStmt" (ppr stmt) = pprPanic "rn_rec_stmt: RecStmt" (ppr stmt)
......
...@@ -905,7 +905,7 @@ What does M export? AvailTC F [FInt] ...@@ -905,7 +905,7 @@ What does M export? AvailTC F [FInt]
The former is strictly right because F isn't defined in this module. The former is strictly right because F isn't defined in this module.
But then you can never do an explicit import of M, thus But then you can never do an explicit import of M, thus
import M( F( FInt ) ) import M( F( FInt ) )
becuase F isn't exported by M. Nor can you import FInt alone from here because F isn't exported by M. Nor can you import FInt alone from here
import M( FInt ) import M( FInt )
because we don't have syntax to support that. (It looks like an import of because we don't have syntax to support that. (It looks like an import of
the type FInt.) the type FInt.)
...@@ -1334,7 +1334,7 @@ each import declaration, what stuff brought into scope by that ...@@ -1334,7 +1334,7 @@ each import declaration, what stuff brought into scope by that
declaration is actually used in the module. declaration is actually used in the module.
The SrcLoc is the location of the END of a particular 'import' The SrcLoc is the location of the END of a particular 'import'
declaration. Why *END*? Becuase we don't want to get confused declaration. Why *END*? Because we don't want to get confused
by the implicit Prelude import. Consider (Trac #7476) the module by the implicit Prelude import. Consider (Trac #7476) the module
import Foo( foo ) import Foo( foo )
main = print foo main = print foo
......
...@@ -277,7 +277,7 @@ We get the following levels ...@@ -277,7 +277,7 @@ We get the following levels
Then 'x' is being scrutinised at a deeper level than its binding, so Then 'x' is being scrutinised at a deeper level than its binding, so
it's added to lc_sruts: [(x,1)] it's added to lc_sruts: [(x,1)]
We do *not* want to specialise the call to 'f', becuase 'x' is not free We do *not* want to specialise the call to 'f', because 'x' is not free
in 'f'. So here the bind-level of 'x' (=1) is not <= the bind-level of 'f' (=0). in 'f'. So here the bind-level of 'x' (=1) is not <= the bind-level of 'f' (=0).
We *do* want to specialise the call to 'g', because 'x' is free in g. We *do* want to specialise the call to 'g', because 'x' is free in g.
......
...@@ -855,7 +855,7 @@ makeIndEnv binds ...@@ -855,7 +855,7 @@ makeIndEnv binds
shortMeOut :: IndEnv -> Id -> Id -> Bool shortMeOut :: IndEnv -> Id -> Id -> Bool
shortMeOut ind_env exported_id local_id shortMeOut ind_env exported_id local_id
-- The if-then-else stuff is just so I can get a pprTrace to see -- The if-then-else stuff is just so I can get a pprTrace to see
-- how often I don't get shorting out becuase of IdInfo stuff -- how often I don't get shorting out because of IdInfo stuff
= if isExportedId exported_id && -- Only if this is exported = if isExportedId exported_id && -- Only if this is exported
isLocalId local_id && -- Only if this one is defined in this isLocalId local_id && -- Only if this one is defined in this
......
...@@ -679,7 +679,7 @@ We *do* transfer the arity from from the in_id of a let binding to the ...@@ -679,7 +679,7 @@ We *do* transfer the arity from from the in_id of a let binding to the
out_id. This is important, so that the arity of an Id is visible in out_id. This is important, so that the arity of an Id is visible in
its own RHS. For example: its own RHS. For example:
f = \x. ....g (\y. f y).... f = \x. ....g (\y. f y)....
We can eta-reduce the arg to g, becuase f is a value. But that We can eta-reduce the arg to g, because f is a value. But that
needs to be visible. needs to be visible.
This interacts with the 'state hack' too: This interacts with the 'state hack' too:
......
...@@ -509,7 +509,7 @@ updModeForInlineRules inline_rule_act current_mode ...@@ -509,7 +509,7 @@ updModeForInlineRules inline_rule_act current_mode
, sm_inline = True , sm_inline = True
, sm_eta_expand = False } , sm_eta_expand = False }
-- For sm_rules, just inherit; sm_rules might be "off" -- For sm_rules, just inherit; sm_rules might be "off"
-- becuase of -fno-enable-rewrite-rules -- because of -fno-enable-rewrite-rules
where where
phaseFromActivation (ActiveAfter n) = Phase n phaseFromActivation (ActiveAfter n) = Phase n
phaseFromActivation _ = InitialPhase phaseFromActivation _ = InitialPhase
...@@ -933,7 +933,7 @@ postInlineUnconditionally dflags env top_lvl bndr occ_info rhs unfolding ...@@ -933,7 +933,7 @@ postInlineUnconditionally dflags env top_lvl bndr occ_info rhs unfolding
= case occ_info of = case occ_info of
-- The point of examining occ_info here is that for *non-values* -- The point of examining occ_info here is that for *non-values*
-- that occur outside a lambda, the call-site inliner won't have -- that occur outside a lambda, the call-site inliner won't have
-- a chance (becuase it doesn't know that the thing -- a chance (because it doesn't know that the thing
-- only occurs once). The pre-inliner won't have gotten -- only occurs once). The pre-inliner won't have gotten
-- it either, if the thing occurs in more than one branch -- it either, if the thing occurs in more than one branch
-- So the main target is things like -- So the main target is things like
......
...@@ -331,7 +331,7 @@ simplLazyBind env top_lvl is_rec bndr bndr1 rhs rhs_se ...@@ -331,7 +331,7 @@ simplLazyBind env top_lvl is_rec bndr bndr1 rhs rhs_se
not_lam (Lam _ _) = False not_lam (Lam _ _) = False
not_lam _ = True not_lam _ = True
-- Do not do the "abstract tyyvar" thing if there's -- Do not do the "abstract tyyvar" thing if there's
-- a lambda inside, becuase it defeats eta-reduction -- a lambda inside, because it defeats eta-reduction
-- f = /\a. \x. g a x -- f = /\a. \x. g a x
-- should eta-reduce -- should eta-reduce
...@@ -781,7 +781,7 @@ on to the old unfolding (which is part of the id). ...@@ -781,7 +781,7 @@ on to the old unfolding (which is part of the id).
Note [Arity decrease] Note [Arity decrease]
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Generally speaking the arity of a binding should not decrease. But it *can* Generally speaking the arity of a binding should not decrease. But it *can*
legitimately happen becuase of RULES. Eg legitimately happen because of RULES. Eg
f = g Int f = g Int
where g has arity 2, will have arity 2. But if there's a rewrite rule where g has arity 2, will have arity 2. But if there's a rewrite rule
g Int --> h g Int --> h
...@@ -2347,7 +2347,7 @@ mkDupableCont env (Select _ case_bndr alts se cont) ...@@ -2347,7 +2347,7 @@ mkDupableCont env (Select _ case_bndr alts se cont)
; (env', dup_cont, nodup_cont) <- prepareCaseCont env alts cont ; (env', dup_cont, nodup_cont) <- prepareCaseCont env alts cont
-- NB: We call prepareCaseCont here. If there is only one -- NB: We call prepareCaseCont here. If there is only one
-- alternative, then dup_cont may be big, but that's ok -- alternative, then dup_cont may be big, but that's ok
-- becuase we push it into the single alternative, and then -- because we push it into the single alternative, and then
-- use mkDupableAlt to turn that simplified alternative into -- use mkDupableAlt to turn that simplified alternative into
-- a join point if it's too big to duplicate. -- a join point if it's too big to duplicate.
-- And this is important: see Note [Fusing case continuations] -- And this is important: see Note [Fusing case continuations]
......
...@@ -587,7 +587,7 @@ We get two specialisations: ...@@ -587,7 +587,7 @@ We get two specialisations:
But perhaps the first one isn't good. After all, we know that tpl_B2 is But perhaps the first one isn't good. After all, we know that tpl_B2 is
a T (I# x) really, because T is strict and Int has one constructor. (We can't a T (I# x) really, because T is strict and Int has one constructor. (We can't
unbox the strict fields, becuase T is polymorphic!) unbox the strict fields, because T is polymorphic!)
%************************************************************************ %************************************************************************
%* * %* *
...@@ -867,7 +867,7 @@ specialiations. Consider ...@@ -867,7 +867,7 @@ specialiations. Consider
If we specialise $j1 then in each specialisation (as well as the original) If we specialise $j1 then in each specialisation (as well as the original)
we can specialise $j2, and similarly $j3. Even if we make just *one* we can specialise $j2, and similarly $j3. Even if we make just *one*
specialisation of each, becuase we also have the original we'll get 2^n specialisation of each, because we also have the original we'll get 2^n
copies of $j3, which is not good. copies of $j3, which is not good.
So when recursively specialising we divide the sc_count by the number of So when recursively specialising we divide the sc_count by the number of
......
...@@ -626,7 +626,7 @@ specImport :: DynFlags ...@@ -626,7 +626,7 @@ specImport :: DynFlags
specImport dflags done rb fn calls_for_fn specImport dflags done rb fn calls_for_fn
| fn `elemVarSet` done | fn `elemVarSet` done
= return ([], []) -- No warning. This actually happens all the time = return ([], []) -- No warning. This actually happens all the time
-- when specialising a recursive function, becuase -- when specialising a recursive function, because
-- the RHS of the specialised function contains a recursive -- the RHS of the specialised function contains a recursive
-- call to the original function -- call to the original function
......
...@@ -232,7 +232,7 @@ lintStgAlts alts scrut_ty = do ...@@ -232,7 +232,7 @@ lintStgAlts alts scrut_ty = do
where where
-- check ty = checkTys first_ty ty (mkCaseAltMsg alts) -- check ty = checkTys first_ty ty (mkCaseAltMsg alts)
-- We can't check that the alternatives have the -- We can't check that the alternatives have the
-- same type, becuase they don't, with unsafeCoerce# -- same type, because they don't, with unsafeCoerce#
lintAlt :: Type -> (AltCon, [Id], [Bool], StgExpr) -> LintM (Maybe Type) lintAlt :: Type -> (AltCon, [Id], [Bool], StgExpr) -> LintM (Maybe Type)
lintAlt _ (DEFAULT, _, _, rhs) lintAlt _ (DEFAULT, _, _, rhs)
......
...@@ -686,7 +686,7 @@ mkTyVarEqErr dflags ctxt extra ct oriented tv1 ty2 ...@@ -686,7 +686,7 @@ mkTyVarEqErr dflags ctxt extra ct oriented tv1 ty2
= reportEqErr ctxt extra ct oriented (mkTyVarTy tv1) ty2 = reportEqErr ctxt extra ct oriented (mkTyVarTy tv1) ty2
-- This *can* happen (Trac #6123, and test T2627b) -- This *can* happen (Trac #6123, and test T2627b)
-- Consider an ambiguous top-level constraint (a ~ F a) -- Consider an ambiguous top-level constraint (a ~ F a)
-- Not an occurs check, becuase F is a type function. -- Not an occurs check, because F is a type function.
where where
occ_check_expand = occurCheckExpand dflags tv1 ty2 occ_check_expand = occurCheckExpand dflags tv1 ty2
k1 = tyVarKind tv1 k1 = tyVarKind tv1
...@@ -866,7 +866,7 @@ mkDictErr ctxt cts ...@@ -866,7 +866,7 @@ mkDictErr ctxt cts
-- Report definite no-instance errors, -- Report definite no-instance errors,
-- or (iff there are none) overlap errors -- or (iff there are none) overlap errors
-- But we report only one of them (hence 'head') becuase they all -- But we report only one of them (hence 'head') because they all
-- have the same source-location origin, to try avoid a cascade -- have the same source-location origin, to try avoid a cascade
-- of error from one location -- of error from one location
; (ctxt, err) <- mk_dict_err ctxt (head (no_inst_cts ++ overlap_cts)) ; (ctxt, err) <- mk_dict_err ctxt (head (no_inst_cts ++ overlap_cts))
......
...@@ -536,7 +536,7 @@ handle the *non-updated* fields. Consider: ...@@ -536,7 +536,7 @@ handle the *non-updated* fields. Consider:
The result type should be (T a b' c) The result type should be (T a b' c)
not (T a b c), because 'b' *is not* mentioned in a non-updated field not (T a b c), because 'b' *is not* mentioned in a non-updated field
not (T a b' c'), becuase 'c' *is* mentioned in a non-updated field not (T a b' c'), because 'c' *is* mentioned in a non-updated field
NB that it's not good enough to look at just one constructor; we must NB that it's not good enough to look at just one constructor; we must
look at them all; cf Trac #3219 look at them all; cf Trac #3219
......
...@@ -500,7 +500,7 @@ unliftedCompare :: PrimOp -> PrimOp ...@@ -500,7 +500,7 @@ unliftedCompare :: PrimOp -> PrimOp
-- Return (if a < b then lt else if a == b then eq else gt) -- Return (if a < b then lt else if a == b then eq else gt)
unliftedCompare lt_op eq_op a_expr b_expr lt eq gt unliftedCompare lt_op eq_op a_expr b_expr lt eq gt
= nlHsIf (genOpApp a_expr (primOpRdrName lt_op) b_expr) lt $ = nlHsIf (genOpApp a_expr (primOpRdrName lt_op) b_expr) lt $
-- Test (<) first, not (==), becuase the latter -- Test (<) first, not (==), because the latter
-- is true less often, so putting it first would -- is true less often, so putting it first would
-- mean more tests (dynamically) -- mean more tests (dynamically)
nlHsIf (genOpApp a_expr (primOpRdrName eq_op) b_expr) eq gt nlHsIf (genOpApp a_expr (primOpRdrName eq_op) b_expr) eq gt
...@@ -690,7 +690,7 @@ instance ... Ix (Foo ...) where ...@@ -690,7 +690,7 @@ instance ... Ix (Foo ...) where
map tag2con_Foo (enumFromTo (I# a#) (I# b#)) map tag2con_Foo (enumFromTo (I# a#) (I# b#))