Commit 0b5ddc7f authored by Brian Wignall's avatar Brian Wignall Committed by Marge Bot

Fix more typos, via an improved Levenshtein-style corrector

parent 350e2b78
Pipeline #14485 failed with stages
in 475 minutes
......@@ -1994,7 +1994,7 @@ case "$1" in
# GHC_LLVM_TARGET(target_cpu, target_vendor, target_os, llvm_target_var)
# --------------------------------
# converts the canonicalized target into someting llvm can understand
# converts the canonicalized target into something llvm can understand
AC_DEFUN([GHC_LLVM_TARGET], [
case "$2-$3" in
*-freebsd*-gnueabihf)
......@@ -2238,7 +2238,7 @@ EOF
# FIND_GHC_BOOTSTRAP_PROG()
# --------------------------------
# Parse the bootstrap GHC's compier settings file for the location of things
# Parse the bootstrap GHC's compiler settings file for the location of things
# like the `llc` and `opt` commands.
#
# $1 = the variable to set
......
......@@ -723,7 +723,7 @@ mkTopStgRhs dflags this_mod ccs bndr rhs
(_, all_cafs_ccs) = getAllCAFsCC this_mod
-- Generate a non-top-level RHS. Cost-centre is always currentCCS,
-- see Note [Cost-centre initialzation plan].
-- see Note [Cost-centre initialization plan].
mkStgRhs :: Id -> StgExpr -> StgRhs
mkStgRhs bndr rhs
| StgLam bndrs body <- rhs
......@@ -837,7 +837,7 @@ data LetInfo
-- For a let(rec)-bound variable, x, we record LiveInfo, the set of
-- variables that are live if x is live. This LiveInfo comprises
-- (a) dynamic live variables (ones with a non-top-level binding)
-- (b) static live variabes (CAFs or things that refer to CAFs)
-- (b) static live variables (CAFs or things that refer to CAFs)
--
-- For "normal" variables (a) is just x alone. If x is a let-no-escaped
-- variable then x is represented by a code pointer and a stack pointer
......
......@@ -345,7 +345,7 @@ type instance XXHsBindsLR (GhcPass pL) (GhcPass pR) = NoExtCon
--
-- See Note [AbsBinds]
-- | Abtraction Bindings Export
-- | Abstraction Bindings Export
data ABExport p
= ABE { abe_ext :: XABE p
, abe_poly :: IdP p -- ^ Any INLINE pragma is attached to this Id
......@@ -562,7 +562,7 @@ again we can desugar without a let:
undef = /\ a. \ (d:HasCallStack) -> error a d "undef"
The abs_sig field supports this direct desugaring, with no local
let-bining. When abs_sig = True
let-binding. When abs_sig = True
* the abs_binds is single FunBind
......
......@@ -907,7 +907,7 @@ Invariants
depend on group_tyclds, or on earlier TyClGroups, but not on later
ones.
See Note [Dependency analsis of type, class, and instance decls]
See Note [Dependency analysis of type, class, and instance decls]
in GHC.Rename.Source for more info.
-}
......@@ -1189,7 +1189,7 @@ data HsDataDefn pass -- The payload of a data type defn
-- For @data T a where { T1 :: T a }@
-- the 'LConDecls' all have 'ConDeclGADT'.
dd_derivs :: HsDeriving pass -- ^ Optional 'deriving' claues
dd_derivs :: HsDeriving pass -- ^ Optional 'deriving' clause
-- For details on above see note [Api annotations] in ApiAnnotation
}
......@@ -1412,7 +1412,7 @@ There's a wrinkle in ConDeclGADT
con_args = PrefixCon []
con_res_ty = a :*: (b -> (a :*: (b -> (a :+: b))))
- In the renamer (GHC.Rename.Source.rnConDecl), we unravel it afer
- In the renamer (GHC.Rename.Source.rnConDecl), we unravel it after
operator fixities are sorted. So we generate. So we end
up with
con_args = PrefixCon [ a :*: b, a :*: b ]
......
......@@ -674,7 +674,7 @@ data HsType pass
| HsExplicitListTy -- A promoted explicit list
(XExplicitListTy pass)
PromotionFlag -- whether explcitly promoted, for pretty printer
PromotionFlag -- whether explicitly promoted, for pretty printer
[LHsType pass]
-- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @"'["@,
-- 'ApiAnnotation.AnnClose' @']'@
......@@ -888,7 +888,7 @@ type LConDeclField pass = Located (ConDeclField pass)
-- For details on above see note [Api annotations] in ApiAnnotation
-- | Constructor Declaration Field
data ConDeclField pass -- Record fields have Haddoc docs on them
data ConDeclField pass -- Record fields have Haddock docs on them
= ConDeclField { cd_fld_ext :: XConDeclField pass,
cd_fld_names :: [LFieldOcc pass],
-- ^ See Note [ConDeclField passs]
......@@ -958,7 +958,7 @@ gives
hsWcScopedTvs :: LHsSigWcType GhcRn -> [Name]
-- Get the lexically-scoped type variables of a HsSigType
-- - the explicitly-given forall'd type variables
-- - the named wildcars; see Note [Scoping of named wildcards]
-- - the named wildcards; see Note [Scoping of named wildcards]
-- because they scope in the same way
hsWcScopedTvs sig_ty
| HsWC { hswc_ext = nwcs, hswc_body = sig_ty1 } <- sig_ty
......
......@@ -551,7 +551,7 @@ mkBigLHsPatTup = mkChunkified mkLHsPatTup
-- #big_tuples#
--
-- GHCs built in tuples can only go up to 'mAX_TUPLE_SIZE' in arity, but
-- we might concievably want to build such a massive tuple as part of the
-- we might conceivably want to build such a massive tuple as part of the
-- output of a desugaring stage (notably that for list comprehensions).
--
-- We call tuples above this size \"big tuples\", and emulate them by
......@@ -566,7 +566,7 @@ mkBigLHsPatTup = mkChunkified mkLHsPatTup
-- and 'mkTupleCase' functions to do all your work with tuples you should be
-- fine, and not have to worry about the arity limitation at all.
-- | Lifts a \"small\" constructor into a \"big\" constructor by recursive decompositon
-- | Lifts a \"small\" constructor into a \"big\" constructor by recursive decomposition
mkChunkified :: ([a] -> a) -- ^ \"Small\" constructor function, of maximum input arity 'mAX_TUPLE_SIZE'
-> [a] -- ^ Possible \"big\" list of things to construct from
-> a -- ^ Constructed thing made possible by recursive decomposition
......
......@@ -83,7 +83,7 @@ import Data.Ord (comparing)
import qualified Data.Semigroup as Semigroup
import Data.Tuple (swap)
-- Debugging Infrastructre
-- Debugging Infrastructure
tracePm :: String -> SDoc -> DsM ()
tracePm herald doc = do
......@@ -142,7 +142,7 @@ mkOneConFull arg_tys con = do
-- pprTrace "mkOneConFull" (ppr con $$ ppr arg_tys $$ ppr univ_tvs $$ ppr _con_res_ty) (return ())
-- Substitute universals for type arguments
let subst_univ = zipTvSubst univ_tvs arg_tys
-- Instantiate fresh existentials as arguments to the contructor. This is
-- Instantiate fresh existentials as arguments to the constructor. This is
-- important for instantiating the Thetas and field types.
(subst, _) <- cloneTyVarBndrs subst_univ ex_tvs <$> getUniqueSupplyM
let field_tys' = substTys subst field_tys
......@@ -175,7 +175,7 @@ Consider the following code (see #12957 and #15450):
We want to warn that the pattern-matching in `f` is non-exhaustive. But GHC
used not to do this; in fact, it would warn that the match was /redundant/!
This is because the constraint (Int ~ Bool) in `f` is unsatisfiable, and the
coverage checker deems any matches with unsatifiable constraint sets to be
coverage checker deems any matches with unsatisfiable constraint sets to be
unreachable.
We decide to better than this. When beginning coverage checking, we first
......@@ -562,7 +562,7 @@ tyIsSatisfiable recheck_complete_sets new_ty_cs = SC $ \delta ->
Invariant applying to each VarInfo: Whenever we have @(C, [y,z])@ in 'vi_pos',
any entry in 'vi_neg' must be incomparable to C (return Nothing) according to
'eqPmAltCons'. Those entries that are comparable either lead to a refutation
or are redudant. Examples:
or are redundant. Examples:
* @x ~ Just y@, @x /~ [Just]@. 'eqPmAltCon' returns @Equal@, so refute.
* @x ~ Nothing@, @x /~ [Just]@. 'eqPmAltCon' returns @Disjoint@, so negative
info is redundant and should be discarded.
......@@ -934,7 +934,7 @@ guessConLikeUnivTyArgsFromResTy _ res_ty (PatSynCon ps) = do
subst <- tcMatchTy con_res_ty res_ty
traverse (lookupTyVar subst) univ_tvs
-- | Kind of tries to add a non-void contraint to 'Delta', but doesn't really
-- | Kind of tries to add a non-void constraint to 'Delta', but doesn't really
-- commit to upholding that constraint in the future. This will be rectified
-- in a follow-up patch. The status quo should work good enough for now.
addVarNonVoidCt :: Delta -> Id -> MaybeT DsM Delta
......@@ -1340,7 +1340,7 @@ determine whether a strict type is inhabitable by a terminating value or not.
`nonVoid ty` returns True when either:
1. `ty` has at least one InhabitationCandidate for which both its term and type
constraints are satifiable, and `nonVoid` returns `True` for all of the
constraints are satisfiable, and `nonVoid` returns `True` for all of the
strict argument types in that InhabitationCandidate.
2. We're unsure if it's inhabited by a terminating value.
......
......@@ -304,7 +304,7 @@ concatM :: Monad m => [m [a]] -> m [a]
concatM xs = concat <$> sequence xs
{- Note [Capturing Scopes and other non local information]
toHie is a local tranformation, but scopes of bindings cannot be known locally,
toHie is a local transformation, but scopes of bindings cannot be known locally,
hence we have to push the relevant info down into the binding nodes.
We use the following types (*Context and *Scoped) to wrap things and
carry the required info
......@@ -479,7 +479,7 @@ instance HasLoc (HsDataDefn GhcRn) where
loc _ = noSrcSpan
{- Note [Real DataCon Name]
The typechecker subtitutes the conLikeWrapId for the name, but we don't want
The typechecker substitutes the conLikeWrapId for the name, but we don't want
this showing up in the hieFile, so we replace the name in the Id with the
original datacon name
See also Note [Data Constructor Naming]
......
......@@ -406,7 +406,7 @@ lookupConstructorFields :: Name -> RnM [FieldLabel]
-- data type decls
--
-- * For constructors from imported modules, use the *type* environment
-- since imported modles are already compiled, the info is conveniently
-- since imported modules are already compiled, the info is conveniently
-- right there
lookupConstructorFields con_name
......
......@@ -70,7 +70,7 @@ type MiniFixityEnv = FastStringEnv (Located Fixity)
--
-- It is keyed by the *FastString*, not the *OccName*, because
-- the single fixity decl infix 3 T
-- affects both the data constructor T and the type constrctor T
-- affects both the data constructor T and the type constructor T
--
-- We keep the location so that if we find
-- a duplicate, we can report it sensibly
......@@ -181,7 +181,7 @@ lookupTyFixityRn :: Located Name -> RnM Fixity
lookupTyFixityRn = lookupFixityRn . unLoc
-- | Look up the fixity of a (possibly ambiguous) occurrence of a record field
-- selector. We use 'lookupFixityRn'' so that we can specifiy the 'OccName' as
-- selector. We use 'lookupFixityRn'' so that we can specify the 'OccName' as
-- the field label, which might be different to the 'OccName' of the selector
-- 'Name' if @DuplicateRecordFields@ is in use (#1173). If there are
-- multiple possible selectors with different fixities, generate an error.
......
......@@ -93,7 +93,7 @@ graph. So we can just worry mostly about direct imports.
There is one trust property that can change for a package though without
recompilation being triggered: package trust. So we must check that all
packages a module tranitively depends on to be trusted are still trusted when
packages a module transitively depends on to be trusted are still trusted when
we are compiling this module (as due to recompilation avoidance some modules
below may not be considered trusted any more without recompilation being
triggered).
......@@ -406,7 +406,7 @@ calculateAvails dflags iface mod_safe' want_boot imported_by =
-- reported. Easiest thing is just to filter them out up
-- front. This situation only arises if a module imports
-- itself, or another module that imported it. (Necessarily,
-- this invoves a loop.)
-- this involves a loop.)
--
-- We do this *after* filterImports, so that if you say
-- module A where
......@@ -1510,7 +1510,7 @@ decls, and simply trim their import lists. NB that
* We do *not* change the 'qualified' or 'as' parts!
* We do not disard a decl altogether; we might need instances
* We do not discard a decl altogether; we might need instances
from it. Instead we just trim to an empty import list
-}
......
......@@ -700,7 +700,7 @@ rnFamInstEqn doc atfi rhs_kvars
-- bound in the type patterns.
; payload_kvar_names <- mapM (newTyVarNameRn mb_cls) payload_kvars
-- all names not bound in an explict forall
-- all names not bound in an explicit forall
; let all_imp_var_names = imp_var_names ++ payload_kvar_names
-- All the free vars of the family patterns
......@@ -768,7 +768,7 @@ rnTyFamInstDecl atfi (TyFamInstDecl { tfid_eqn = eqn })
-- 1. A type family equation that is not associated
-- with a parent type class ('NonAssocTyFamEqn')
--
-- 2. An associated type family default delcaration ('AssocTyFamDeflt')
-- 2. An associated type family default declaration ('AssocTyFamDeflt')
--
-- 3. An associated type family instance declaration ('AssocTyFamInst')
data AssocTyFamInfo
......
......@@ -658,7 +658,7 @@ rnTyVar env rdr_name
; return name }
rnLTyVar :: Located RdrName -> RnM (Located Name)
-- Called externally; does not deal with wildards
-- Called externally; does not deal with wildcards
rnLTyVar (L loc rdr_name)
= do { tyvar <- lookupTypeOccRn rdr_name
; return (L loc tyvar) }
......
......@@ -2,7 +2,7 @@
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1997-1998
\section[BasicTypes]{Miscellanous types}
\section[BasicTypes]{Miscellaneous types}
This module defines a miscellaneously collection of very simple
types that
......@@ -970,8 +970,8 @@ data InterestingCxt
| NotInteresting
deriving (Eq)
-- | If there is any 'interesting' identifier occurance, then the
-- aggregated occurance info of that identifier is considered interesting.
-- | If there is any 'interesting' identifier occurrence, then the
-- aggregated occurrence info of that identifier is considered interesting.
instance Semi.Semigroup InterestingCxt where
NotInteresting <> x = x
IsInteresting <> _ = IsInteresting
......@@ -990,8 +990,8 @@ data InsideLam
| NotInsideLam
deriving (Eq)
-- | If any occurance of an identifier is inside a lambda, then the
-- occurance info of that identifier marks it as occuring inside a lambda
-- | If any occurrence of an identifier is inside a lambda, then the
-- occurrence info of that identifier marks it as occurring inside a lambda
instance Semi.Semigroup InsideLam where
NotInsideLam <> x = x
IsInsideLam <> _ = IsInsideLam
......@@ -1003,7 +1003,7 @@ instance Monoid InsideLam where
-----------------
data OneBranch
= InOneBranch
-- ^ One syntactic occurance: Occurs in only one case branch
-- ^ One syntactic occurrence: Occurs in only one case branch
-- so no code-duplication issue to worry about
| MultipleBranches
deriving (Eq)
......
......@@ -526,7 +526,7 @@ This too would get <Str, Used>, but this time there really isn't any
point in w/w since the components of the pair are not used at all.
So the solution is: don't aggressively collapse UProd [Used,Used] to
Used; intead leave it as-is. In effect we are using the UseDmd to do a
Used; instead leave it as-is. In effect we are using the UseDmd to do a
little bit of boxity analysis. Not very nice.
Note [Used should win]
......@@ -700,7 +700,7 @@ cleanEvalProdDmd n = JD { sd = HeadStr, ud = UProd (replicate n useTop) }
{-
************************************************************************
* *
Demand: combining stricness and usage
Demand: combining strictness and usage
* *
************************************************************************
-}
......@@ -1089,7 +1089,7 @@ For a
The CPR information, though, is valid after the number of arguments mentioned
in the type is given. Therefore, when forgetting the demand on arguments, as in
dmdAnalRhs, this needs to be considere (via removeDmdTyArgs).
dmdAnalRhs, this needs to be considered (via removeDmdTyArgs).
Consider
b2 x y = x `seq` y `seq` error (show x)
......@@ -1128,7 +1128,7 @@ We
3. combine the termination results, but
4. take CPR info from the first argument.
3 and 4 are implementd in bothDmdResult.
3 and 4 are implemented in bothDmdResult.
-}
-- Equality needed for fixpoints in DmdAnal
......@@ -1444,7 +1444,7 @@ Note [Default demand on free variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the variable is not mentioned in the environment of a demand type,
its demand is taken to be a result demand of the type.
For the stricness component,
For the strictness component,
if the result demand is a Diverges, then we use HyperStr
else we use Lazy
For the usage component, we use Absent.
......
......@@ -250,7 +250,7 @@ data IdInfo
oneShotInfo :: OneShotInfo,
-- ^ Info about a lambda-bound variable, if the 'Id' is one
inlinePragInfo :: InlinePragma,
-- ^ Any inline pragma atached to the 'Id'
-- ^ Any inline pragma attached to the 'Id'
occInfo :: OccInfo,
-- ^ How the 'Id' occurs in the program
strictnessInfo :: StrictSig,
......@@ -425,7 +425,7 @@ data RuleInfo
-- ru_fn though.
-- Note [Rule dependency info] in OccurAnal
-- | Assume that no specilizations exist: always safe
-- | Assume that no specializations exist: always safe
emptyRuleInfo :: RuleInfo
emptyRuleInfo = RuleInfo [] emptyDVarSet
......
......@@ -831,7 +831,7 @@ Here are the moving parts:
* We define LitRubbish as a constructor in Literal.Literal
* It is given its polymoprhic type by Literal.literalType
* It is given its polymorphic type by Literal.literalType
* WwLib.mk_absent_let introduces a LitRubbish for absent
arguments of boxed, unlifted type.
......@@ -842,7 +842,7 @@ Here are the moving parts:
which the garbage collector can follow if it encounters it.
We considered maintaining LitRubbish in STG, and lowering
it in the code genreators, but it seems simpler to do it
it in the code generators, but it seems simpler to do it
once and for all in CoreToSTG.
In ByteCodeAsm we just lower it as a 0 literal, because
......
......@@ -1178,7 +1178,7 @@ wrapNewTypeBody tycon args result_expr
-- When unwrapping, we do *not* apply any family coercion, because this will
-- be done via a CoPat by the type checker. We have to do it this way as
-- computing the right type arguments for the coercion requires more than just
-- a splitting operation (cf, TcPat.tcConPat).
unwrapNewTypeBody :: TyCon -> [Type] -> CoreExpr -> CoreExpr
unwrapNewTypeBody tycon args result_expr
......
......@@ -1068,7 +1068,7 @@ versions of them installed. To the user, everything looks normal.
However, for each invocation of GHC, only a single instance of each wired-in
package will be recognised (the desired one is selected via
@-package@\/@-hide-package@), and GHC will internall pretend that it has the
@-package@\/@-hide-package@), and GHC will internally pretend that it has the
*unversioned* 'UnitId', including in .hi files and object file symbols.
Unselected versions of wired-in packages will be ignored, as will any other
......
......@@ -452,7 +452,7 @@ type GlobalRdrEnv = OccEnv [GlobalRdrElt]
--
-- NB: greOccName gre is usually the same as
-- nameOccName (gre_name gre), but not always in the
-- case of record seectors; see greOccName
-- case of record selectors; see greOccName
-- | Global Reader Element
--
......@@ -509,7 +509,7 @@ gre_lcl is True, or gre_imp is non-empty.
It is just possible to have *both* if there is a module loop: a Name
is defined locally in A, and also brought into scope by importing a
module that SOURCE-imported A. Exapmle (#7672):
module that SOURCE-imported A. Example (#7672):
A.hs-boot module A where
data T
......
......@@ -803,7 +803,7 @@ maybeLocalBlockLabel _ = Nothing
-- | Check whether a label corresponds to a C function that has
-- a prototype in a system header somehere, or is built-in
-- a prototype in a system header somewhere, or is built-in
-- to the C compiler. For these labels we avoid generating our
-- own C prototypes.
isMathFun :: CLabel -> Bool
......@@ -1474,7 +1474,7 @@ mayRedirectTo symbol target
{-
Note [emit-time elimination of static indirections]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As described in #15155, certain static values are repesentationally
As described in #15155, certain static values are representationally
equivalent, e.g. 'cast'ed values (when created by 'newtype' wrappers).
newtype A = A Int
......
......@@ -324,7 +324,7 @@ targetSupportsSwitch _ = False
-- | This function creates a SwitchPlan from a SwitchTargets value, breaking it
-- down into smaller pieces suitable for code generation.
createSwitchPlan :: SwitchTargets -> SwitchPlan
-- Lets do the common case of a singleton map quicky and efficiently (#10677)
-- Lets do the common case of a singleton map quickly and efficiently (#10677)
createSwitchPlan (SwitchTargets _signed _range (Just defLabel) m)
| [(x, l)] <- M.toList m
= IfEqual x l (Unconditionally defLabel)
......@@ -484,7 +484,7 @@ reassocTuples initial ((a,b):tuples) last
--
-- - CmmSwitch, which provides the CmmSwitchTargets type and contains the strategy
-- for implementing a Cmm switch (createSwitchPlan), and
-- - CmmImplementSwitchPlans, which contains the actuall Cmm graph modification,
-- - CmmImplementSwitchPlans, which contains the actual Cmm graph modification,
--
-- for these reasons:
--
......
......@@ -267,7 +267,7 @@ Or, to put it another way
there is no work lost in duplicating the partial
application (e x1 .. x(n-1))
In the divegent case, no work is lost by duplicating because if the thing
In the divergent case, no work is lost by duplicating because if the thing
is evaluated once, that's the end of the program.
Or, to put it another way, in any context C
......@@ -356,7 +356,7 @@ we want to get: coerce T (\x::[T] -> (coerce ([T]->Int) e) x)
HOWEVER, note that if you use coerce bogusly you can ge
coerce Int negate
And since negate has arity 2, you might try to eta expand. But you can't
decopose Int to a function type. Hence the final case in eta_expand.
decompose Int to a function type. Hence the final case in eta_expand.
Note [The state-transformer hack]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -855,7 +855,7 @@ returns a CoreExpr satisfying the same invariant. See Note [Eta
expansion and the CorePrep invariants] in CorePrep.
This means the eta-expander has to do a bit of on-the-fly
simplification but it's not too hard. The alernative, of relying on
simplification but it's not too hard. The alternative, of relying on
a subsequent clean-up phase of the Simplifier to de-crapify the result,
means you can't really use it in CorePrep, which is painful.
......@@ -1106,7 +1106,7 @@ mkEtaWW orig_n orig_expr in_scope orig_ty
-- is levity-polymorphic
= WARN( True, (ppr orig_n <+> ppr orig_ty) $$ ppr orig_expr )
(getTCvInScope subst, reverse eis)
-- This *can* legitmately happen:
-- This *can* legitimately happen:
-- e.g. coerce Int (\x. x) Essentially the programmer is
-- playing fast and loose with types (Happy does this a lot).
-- So we simply decline to eta-expand. Otherwise we'd end up
......
......@@ -833,7 +833,7 @@ We need to be careful about UTF8 strings here. ""# contains a ByteString, so
we must parse it back into a FastString to split off the first character.
That way we can treat unpackCString# and unpackCStringUtf8# in the same way.
We must also be caeful about
We must also be careful about
lvl = "foo"#
...(unpackCString# lvl)...
to ensure that we see through the let-binding for 'lvl'. Hence the
......@@ -1138,7 +1138,7 @@ to compute the type arguments to the dictionary constructor.
Note [DFun arity check]
~~~~~~~~~~~~~~~~~~~~~~~
Here we check that the total number of supplied arguments (inclding
Here we check that the total number of supplied arguments (including
type args) matches what the dfun is expecting. This may be *less*
than the ordinary arity of the dfun: see Note [DFun unfoldings] in CoreSyn
-}
......
......@@ -225,7 +225,7 @@ But caching the type in the Case constructor
exprType (Case scrut bndr ty alts) = ty
is better for at least three reasons:
* It works when there are no alternatives (see case invarant 1 above)
* It works when there are no alternatives (see case invariant 1 above)
* It might be faster in deeply-nested situations.
......@@ -1042,7 +1042,7 @@ data TickishScoping =
-- ==>
-- tick<...> case foo of x -> bar
--
-- While this is always leagl, we want to make a best effort to
-- While this is always legal, we want to make a best effort to
-- only make us of this where it exposes transformation
-- opportunities.
| SoftScope
......@@ -1262,8 +1262,8 @@ its left hand side mentions nothing defined in this module. Orphan-hood
has two major consequences
* A module that contains orphans is called an "orphan module". If
the module being compiled depends (transitively) on an oprhan
module M, then M.hi is read in regardless of whether M is oherwise
the module being compiled depends (transitively) on an orphan
module M, then M.hi is read in regardless of whether M is otherwise
needed. This is to ensure that we don't miss any instance decls in
M. But it's painful, because it means we need to keep track of all
the orphan modules below us.
......@@ -1273,7 +1273,7 @@ has two major consequences
mentions on the LHS. For example
data T = T1 | T2
instance Eq T where ....
The instance (Eq T) is incorprated as part of T's fingerprint.
The instance (Eq T) is incorporated as part of T's fingerprint.
In contrast, orphans are all fingerprinted together in the
mi_orph_hash field of the ModIface.
......
......@@ -226,13 +226,13 @@ specUnfolding to specialise its unfolding. Some important points:
{- INLINABLE f #-}
Now if we specialise f, should the specialised version still have
an INLINABLE pragma? If it does, we'll capture a specialised copy
of <big-rhs> as its unfolding, and that probaby won't inline. But
of <big-rhs> as its unfolding, and that probably won't inline. But
if we don't, the specialised version of <big-rhs> might be small
enough to inline at a call site. This happens with Control.Monad.liftM3,
and can cause a lot more allocation as a result (nofib n-body shows this).
Moreover, keeping the INLINABLE thing isn't much help, because
the specialised function (probaby) isn't overloaded any more.
the specialised function (probably) isn't overloaded any more.
Conclusion: drop the INLINEALE pragma. In practice what this means is:
if a stable unfolding has UnfoldingGuidance of UnfWhen,
......@@ -255,7 +255,7 @@ The semantics of an INLINE pragma is
that is, applied to at least as many arguments as appear
on the LHS of the Haskell source definition.
(This soure-code-derived arity is stored in the `ug_arity` field of
(This source-code-derived arity is stored in the `ug_arity` field of
the `UnfoldingGuidance`.)
In the example, x's ug_arity is 0, so we should inline it at every use
......@@ -362,14 +362,14 @@ the unfolding in question was a DFun unfolding.
But more generally, the simplifier is designed on the
basis that it is looking at occurrence-analysed expressions, so better
ensure that they acutally are.
ensure that they actually are.
We use occurAnalyseExpr_NoBinderSwap instead of occurAnalyseExpr;
see Note [No binder swap in unfoldings].
Note [No binder swap in unfoldings]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The binder swap can temporarily violate Core Lint, by assinging
The binder swap can temporarily violate Core Lint, by assigning
a LocalId binding to a GlobalId. For example, if A.foo{r872}
is a GlobalId with unique r872, then
......@@ -528,7 +528,7 @@ are very cheap, because exposing them to a caller is so valuable.
[25/5/11] All sizes are now multiplied by 10, except for primops
(which have sizes like 1 or 4. This makes primops look fantastically
cheap, and seems to be almost unversally beneficial. Done partly as a
cheap, and seems to be almost universally beneficial. Done partly as a
result of #4978.
Note [Do not inline top-level bottoming functions]
......@@ -1612,5 +1612,5 @@ computeDiscount dflags arg_discounts res_discount arg_infos cont_info