diff options
author | Eric Lindblad <lindblad@gmx.us> | 2022-09-13 10:31:23 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-09-14 03:13:56 -0400 |
commit | 646d15ad8f1119f339998ee8dd79ea96cfd1d165 (patch) | |
tree | 84bc30035fb31ea0f418384b2399400d53539cbf /compiler/GHC | |
parent | dc6af9ed87e619d754bfc385df931c81cba6d93a (diff) | |
download | haskell-646d15ad8f1119f339998ee8dd79ea96cfd1d165.tar.gz |
Fix typos
This fixes various typos and spelling mistakes
in the compiler.
Fixes #21891
Diffstat (limited to 'compiler/GHC')
189 files changed, 391 insertions, 391 deletions
diff --git a/compiler/GHC/Builtin/PrimOps.hs b/compiler/GHC/Builtin/PrimOps.hs index 574cfa4659..ecd9da0ac2 100644 --- a/compiler/GHC/Builtin/PrimOps.hs +++ b/compiler/GHC/Builtin/PrimOps.hs @@ -658,7 +658,7 @@ to link primops; it rather does a rather hacky symbol lookup (see GHC.ByteCode.Linker.primopToCLabel). TODO: Perhaps this should be changed? Note that these wrappers aren't *quite* as expressive as their unwrapped -breathren, in that they may exhibit less representation polymorphism. +brethren, in that they may exhibit less representation polymorphism. For instance, consider the case of mkWeakNoFinalizer#, which has type: mkWeakNoFinalizer# :: forall (r :: RuntimeRep) (k :: TYPE r) (v :: Type). diff --git a/compiler/GHC/Builtin/Types.hs b/compiler/GHC/Builtin/Types.hs index 9410100737..378f348b61 100644 --- a/compiler/GHC/Builtin/Types.hs +++ b/compiler/GHC/Builtin/Types.hs @@ -282,7 +282,7 @@ wiredInTyCons = [ -- Units are not treated like other tuples, because they unitTyCon , unboxedUnitTyCon - -- Solo (i.e., the bosed 1-tuple) is also not treated + -- Solo (i.e., the boxed 1-tuple) is also not treated -- like other tuples (i.e. we /do/ include it here), -- since it does not use special syntax like other tuples -- See Note [One-tuples] (Wrinkle: Make boxed one-tuple names diff --git a/compiler/GHC/Builtin/Uniques.hs b/compiler/GHC/Builtin/Uniques.hs index acf835c996..e689ca6304 100644 --- a/compiler/GHC/Builtin/Uniques.hs +++ b/compiler/GHC/Builtin/Uniques.hs @@ -37,7 +37,7 @@ module GHC.Builtin.Uniques , mkBuiltinUnique , mkPseudoUniqueE - -- ** Deriving uniquesc + -- ** Deriving uniques -- *** From TyCon name uniques , tyConRepNameUnique -- *** From DataCon name uniques diff --git a/compiler/GHC/ByteCode/Instr.hs b/compiler/GHC/ByteCode/Instr.hs index 17c39b7220..e5cd896c1c 100644 --- a/compiler/GHC/ByteCode/Instr.hs +++ b/compiler/GHC/ByteCode/Instr.hs @@ -68,12 +68,12 @@ data BCInstr | PUSH16 !Word16 | PUSH32 !Word16 - -- Push the specifiec local as a 8, 16, 32 bit value onto the stack, but the + -- Push the specified local as a 8, 16, 32 bit value onto the stack, but the -- value will take the whole word on the stack (i.e., the stack will grow by -- a word) -- This is useful when extracting a packed constructor field for further use. -- Currently we expect all values on the stack to take full words, except for - -- the ones used for PACK (i.e., actually constracting new data types, in + -- the ones used for PACK (i.e., actually constructing new data types, in -- which case we use PUSH{8,16,32}) | PUSH8_W !Word16 | PUSH16_W !Word16 @@ -299,9 +299,9 @@ instance Outputable BCInstr where ppr (TESTEQ_P i lab) = text "TESTEQ_P" <+> ppr i <+> text "__" <> ppr lab ppr CASEFAIL = text "CASEFAIL" ppr (JMP lab) = text "JMP" <+> ppr lab - ppr (CCALL off marshall_addr flags) = text "CCALL " <+> ppr off + ppr (CCALL off marshal_addr flags) = text "CCALL " <+> ppr off <+> text "marshal code at" - <+> text (show marshall_addr) + <+> text (show marshal_addr) <+> (case flags of 0x1 -> text "(interruptible)" 0x2 -> text "(unsafe)" diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs index 5a969d30f5..b718b73f30 100644 --- a/compiler/GHC/Cmm/CLabel.hs +++ b/compiler/GHC/Cmm/CLabel.hs @@ -1,6 +1,6 @@ ----------------------------------------------------------------------------- -- --- Object-file symbols (called CLabel for histerical raisins). +-- Object-file symbols (called CLabel for historical reasons). -- -- (c) The University of Glasgow 2004-2006 -- @@ -612,7 +612,7 @@ mkClosureTableLabel :: Name -> CafInfo -> CLabel mkConInfoTableLabel :: Name -> ConInfoTableLocation -> CLabel mkBytesLabel :: Name -> CLabel mkClosureLabel name c = IdLabel name c Closure --- | Decicdes between external and local labels based on the names externality. +-- | Decides between external and local labels based on the names externality. mkInfoTableLabel name c | isExternalName name = IdLabel name c InfoTable | otherwise = IdLabel name c LocalInfoTable diff --git a/compiler/GHC/Cmm/ContFlowOpt.hs b/compiler/GHC/Cmm/ContFlowOpt.hs index 350f94c818..a9bb7b673e 100644 --- a/compiler/GHC/Cmm/ContFlowOpt.hs +++ b/compiler/GHC/Cmm/ContFlowOpt.hs @@ -334,7 +334,7 @@ blockConcat splitting_procs g@CmmGraph { g_entry = entry_id } In this case we could assume that we will end up with a jump for BOTH branches. In this case it might be best to put the likely path in the true branch especially if there are large numbers of predecessors as this saves - us the jump thats not taken. However I haven't tested this and as of early + us the jump that's not taken. However I haven't tested this and as of early 2018 we almost never generate cmm where this would apply. -} diff --git a/compiler/GHC/Cmm/Dataflow.hs b/compiler/GHC/Cmm/Dataflow.hs index edd91481e7..1e5376e2bf 100644 --- a/compiler/GHC/Cmm/Dataflow.hs +++ b/compiler/GHC/Cmm/Dataflow.hs @@ -87,7 +87,7 @@ type TransferFun' (n :: Extensibility -> Extensibility -> Type) f = Block n C C -> FactBase f -> FactBase f --- | Function for rewrtiting and analysis combined. To be used with +-- | Function for rewriting and analysis combined. To be used with -- @rewriteCmm@. -- -- Currently set to work with @UniqSM@ monad, but we could probably abstract diff --git a/compiler/GHC/Cmm/Liveness.hs b/compiler/GHC/Cmm/Liveness.hs index 769c701c2b..c7d3217959 100644 --- a/compiler/GHC/Cmm/Liveness.hs +++ b/compiler/GHC/Cmm/Liveness.hs @@ -103,7 +103,7 @@ xferLive platform (BlockCC eNode middle xNode) fBase = ----------------------------------------------------------------------------- -- | Specialization that only retains the keys for local variables. -- --- Local variablas are mostly glorified Ints, and some parts of the compiler +-- Local variables are mostly glorified Ints, and some parts of the compiler -- really don't care about anything but the Int part. So we can avoid some -- overhead by computing a IntSet instead of a Set LocalReg which (unsurprisingly) -- is quite a bit faster. diff --git a/compiler/GHC/Cmm/Sink.hs b/compiler/GHC/Cmm/Sink.hs index 68b20fd307..9ad5c455ac 100644 --- a/compiler/GHC/Cmm/Sink.hs +++ b/compiler/GHC/Cmm/Sink.hs @@ -360,7 +360,7 @@ loads from R1. What happens is that we: * The assignment `_c3 = [R1 + 1]`; (R1 already inlined on pickup) conflicts with R1 = R1, because it reads `R1` and the node writes to R1 - * This is clearly no-sensical because `R1 = R1` doesn't affect R1's value. + * This is clearly nonsensical because `R1 = R1` doesn't affect R1's value. The solutions is to check if we can discard nodes before and *after* simplifying them. We could only do it after as well, but I assume doing it early might save @@ -490,7 +490,7 @@ tryToInline platform liveAfter node assigs = where (final_node, rest') = go usages live' node' (insertLRegSet l skipped) rest -- Avoid discarding of assignments to vars on the rhs. - -- See Note [Keeping assignemnts mentioned in skipped RHSs] + -- See Note [Keeping assignments mentioned in skipped RHSs] -- usages' = foldLocalRegsUsed platform (\m r -> addToUFM m r 2) -- usages rhs live' = inline foldLocalRegsUsed platform (\m r -> insertLRegSet r m) @@ -518,7 +518,7 @@ tryToInline platform liveAfter node assigs = inl_exp (CmmMachOp op args) = cmmMachOpFold platform op args inl_exp other = other -{- Note [Keeping assignemnts mentioned in skipped RHSs] +{- Note [Keeping assignments mentioned in skipped RHSs] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we have to assignments: [z = y, y = e1] and we skip z we *must* retain the assignment y = e1. This is because diff --git a/compiler/GHC/Cmm/Switch.hs b/compiler/GHC/Cmm/Switch.hs index b0f22ce1b3..f03eaac70f 100644 --- a/compiler/GHC/Cmm/Switch.hs +++ b/compiler/GHC/Cmm/Switch.hs @@ -365,7 +365,7 @@ breakTooSmall m --- Step 3: Fill in the blanks --- --- | A FlatSwitchPlan is a list of SwitchPlans, with an integer inbetween every +-- | A FlatSwitchPlan is a list of SwitchPlans, with an integer in between every -- two entries, dividing the range. -- So if we have (abusing list syntax) [plan1,n,plan2], then we use plan1 if -- the expression is < n, and plan2 otherwise. diff --git a/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs b/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs index c017f376bb..af2d63cc8b 100644 --- a/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs @@ -179,13 +179,13 @@ ann doc instr {- debugIsOn -} = ANN doc instr -- Using pprExpr will hide the AST, @ANN@ will end up in the assembly with -- -dppr-debug. The idea is that we can trivially see how a cmm expression --- ended up producing the assmebly we see. By having the verbatim AST printed --- we can simply check the patterns that were matched to arrive at the assmebly +-- ended up producing the assembly we see. By having the verbatim AST printed +-- we can simply check the patterns that were matched to arrive at the assembly -- we generated. -- -- pprExpr will hide a lot of noise of the underlying data structure and print -- the expression into something that can be easily read by a human. However --- going back to the exact CmmExpr representation can be labourous and adds +-- going back to the exact CmmExpr representation can be laborious and adds -- indirections to find the matches that lead to the assembly. -- -- An improvement oculd be to have @@ -937,7 +937,7 @@ getRegister' config plat expr -- careful with the floating point operations. -- SLE is effectively LE or unordered (NaN) -- SLT is the same. ULE, and ULT will not return true for NaN. - -- This is a bit counter intutive. Don't let yourself be fooled by + -- This is a bit counter-intuitive. Don't let yourself be fooled by -- the S/U prefix for floats, it's only meaningful for integers. MO_F_Ge w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d OGE ]) MO_F_Le w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d OLE ]) -- x <= y <=> y > x @@ -1550,7 +1550,7 @@ genCCall target dest_regs arg_regs bid = do genCCall (ForeignTarget target cconv) dest_regs arg_regs bid -- TODO: Optimize using paired stores and loads (STP, LDP). It is - -- automomatically done by the allocator for us. However it's not optimal, + -- automatically done by the allocator for us. However it's not optimal, -- as we'd rather want to have control over -- all spill/load registers, so we can optimize with instructions like -- STP xA, xB, [sp, #-16]! diff --git a/compiler/GHC/CmmToAsm/AArch64/Instr.hs b/compiler/GHC/CmmToAsm/AArch64/Instr.hs index 2ac137014a..1eed09d8b3 100644 --- a/compiler/GHC/CmmToAsm/AArch64/Instr.hs +++ b/compiler/GHC/CmmToAsm/AArch64/Instr.hs @@ -338,8 +338,8 @@ patchJumpInstr instr patchF -- -- Using sp to compute the offset will violate assumptions about the stack pointer -- pointing to the top of the stack during signal handling. As we can't force --- every signal to use its own stack, we have to ensure that the stack poitner --- always poitns to the top of the stack, and we can't use it for computation. +-- every signal to use its own stack, we have to ensure that the stack pointer +-- always points to the top of the stack, and we can't use it for computation. -- -- | An instruction to spill a register into a spill slot. mkSpillInstr @@ -541,7 +541,7 @@ data Instr | PUSH_STACK_FRAME | POP_STACK_FRAME -- 1. Arithmetic Instructions ---------------------------------------------- - -- | ADC Operand Operand Operang -- rd = rn + rm + C + -- | ADC Operand Operand Operand -- rd = rn + rm + C -- | ADCS ... | ADD Operand Operand Operand -- rd = rn + rm -- | ADDS Operand Operand Operand -- rd = rn + rm diff --git a/compiler/GHC/CmmToAsm/AArch64/Ppr.hs b/compiler/GHC/CmmToAsm/AArch64/Ppr.hs index 16665b9c57..a27a3297e3 100644 --- a/compiler/GHC/CmmToAsm/AArch64/Ppr.hs +++ b/compiler/GHC/CmmToAsm/AArch64/Ppr.hs @@ -180,7 +180,7 @@ pprGloblDecl platform lbl -- Note [Always use objects for info tables] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- See discussion in X86.Ppr for why this is necessary. Essentially we need to --- ensure that we never pass function symbols when we migth want to lookup the +-- ensure that we never pass function symbols when we might want to lookup the -- info table. If we did, we could end up with procedure linking tables -- (PLT)s, and thus the lookup wouldn't point to the function, but into the -- jump table. @@ -263,7 +263,7 @@ pprIm platform im = case im of ImmInteger i -> char '#' <> integer i -- TODO: This will only work for - -- The floating point value must be expressable as ±n ÷ 16 × 2^r, + -- The floating point value must be expressible as ±n ÷ 16 × 2^r, -- where n and r are integers such that 16 ≤ n ≤ 31 and -3 ≤ r ≤ 4. -- and 0 needs to be encoded as wzr/xzr. -- @@ -307,7 +307,7 @@ pprOp plat op = case op of OpRegShift w r s i -> pprReg w r <> comma <+> pprShift s <+> char '#' <> int i OpImm im -> pprIm plat im OpImmShift im s i -> pprIm plat im <> comma <+> pprShift s <+> char '#' <> int i - -- TODO: Address compuation always use registers as 64bit -- is this correct? + -- TODO: Address computation always use registers as 64bit -- is this correct? OpAddr (AddrRegReg r1 r2) -> char '[' <+> pprReg W64 r1 <> comma <+> pprReg W64 r2 <+> char ']' OpAddr (AddrRegImm r1 im) -> char '[' <+> pprReg W64 r1 <> comma <+> pprImm plat im <+> char ']' OpAddr (AddrReg r1) -> char '[' <+> pprReg W64 r1 <+> char ']' @@ -560,7 +560,7 @@ pprCond c = case c of VS -> text "vs" -- Overflow ; Unordered (at least one NaN operand) VC -> text "vc" -- No overflow ; Not unordered - -- Orderd variants. Respecting NaN. + -- Ordered variants. Respecting NaN. OLT -> text "mi" OLE -> text "ls" OGE -> text "ge" diff --git a/compiler/GHC/CmmToAsm/BlockLayout.hs b/compiler/GHC/CmmToAsm/BlockLayout.hs index 747702658e..f59fb14679 100644 --- a/compiler/GHC/CmmToAsm/BlockLayout.hs +++ b/compiler/GHC/CmmToAsm/BlockLayout.hs @@ -758,7 +758,7 @@ sequenceChain info weights blocks@((BasicBlock entry _):_) = -- builds if something slips through. assert (null unplaced) $ --pprTraceIt "placedBlocks" $ - -- ++ [] is stil kinda expensive + -- ++ [] is still kinda expensive if null unplaced then blockList else blockList ++ unplaced getBlock bid = expectJust "Block placement" $ mapLookup bid blockMap in diff --git a/compiler/GHC/CmmToAsm/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs index fd20bd1c9f..71a1ce6a62 100644 --- a/compiler/GHC/CmmToAsm/CFG.hs +++ b/compiler/GHC/CmmToAsm/CFG.hs @@ -219,7 +219,7 @@ hasNode m node = -- | Check if the nodes in the cfg and the set of blocks are the same. --- In a case of a missmatch we panic and show the difference. +-- In a case of a mismatch we panic and show the difference. sanityCheckCfg :: CFG -> LabelSet -> SDoc -> Bool sanityCheckCfg m blockSet msg | blockSet == cfgNodes @@ -414,11 +414,11 @@ getEdgeInfo from to m getEdgeWeight :: CFG -> BlockId -> BlockId -> EdgeWeight getEdgeWeight cfg from to = - edgeWeight $ expectJust "Edgeweight for noexisting block" $ + edgeWeight $ expectJust "Edgeweight for nonexisting block" $ getEdgeInfo from to cfg getTransitionSource :: BlockId -> BlockId -> CFG -> TransitionSource -getTransitionSource from to cfg = transitionSource $ expectJust "Source info for noexisting block" $ +getTransitionSource from to cfg = transitionSource $ expectJust "Source info for nonexisting block" $ getEdgeInfo from to cfg reverseEdges :: CFG -> CFG @@ -1020,11 +1020,11 @@ Currently implemented is a heuristic to predict that we do not exit loops (lehPredicts) and one to predict that backedges are more likely than any other edge. -The back edge case is special as it superceeds any other heuristic if it +The back edge case is special as it supersedes any other heuristic if it applies. Do NOT rely solely on nofib results for benchmarking this. I recommend at least -comparing megaparsec and container benchmarks. Nofib does not seeem to have +comparing megaparsec and container benchmarks. Nofib does not seem to have many instances of "loopy" Cmm where these make a difference. TODO: diff --git a/compiler/GHC/CmmToAsm/CFG/Dominators.hs b/compiler/GHC/CmmToAsm/CFG/Dominators.hs index 92ef5d95ec..428603d09c 100644 --- a/compiler/GHC/CmmToAsm/CFG/Dominators.hs +++ b/compiler/GHC/CmmToAsm/CFG/Dominators.hs @@ -526,7 +526,7 @@ renum from = (\(_,m,g)->(g,m)) ----------------------------------------------------------------------------- --- Nothing better than reinvinting the state monad. +-- Nothing better than reinventing the state monad. newtype S z s a = S {unS :: forall o. (a -> s -> ST z o) -> s -> ST z o} instance Functor (S z s) where fmap f (S g) = S (\k -> g (k . f)) diff --git a/compiler/GHC/CmmToAsm/CPrim.hs b/compiler/GHC/CmmToAsm/CPrim.hs index fa05bd0e59..67c1da97f7 100644 --- a/compiler/GHC/CmmToAsm/CPrim.hs +++ b/compiler/GHC/CmmToAsm/CPrim.hs @@ -87,7 +87,7 @@ word2FloatLabel = \case atomicRMWLabel :: Width -> AtomicMachOp -> FastString atomicRMWLabel w amop = case amop of -- lots of boring cases, but we do it this way to get shared FastString - -- literals (compared to concatening strings and allocating FastStrings at + -- literals (compared to concatenating strings and allocating FastStrings at -- runtime) AMO_Add -> case w of W8 -> fsLit "hs_atomic_add8" diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs index c58aafbf95..f8563004b5 100644 --- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs @@ -2145,7 +2145,7 @@ genSwitch config expr targets -- See Note [Sub-word subtlety during jump-table indexing] in -- GHC.CmmToAsm.X86.CodeGen for why we must first offset, then widen. indexExpr0 = cmmOffset platform expr offset - -- We widen to a native-width register to santize the high bits + -- We widen to a native-width register to sanitize the high bits indexExpr = CmmMachOp (MO_UU_Conv expr_w (platformWordWidth platform)) [indexExpr0] diff --git a/compiler/GHC/CmmToAsm/Reg/Graph.hs b/compiler/GHC/CmmToAsm/Reg/Graph.hs index 9cbe12caee..40508d39f1 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph.hs @@ -355,8 +355,8 @@ graphAddConflictSet set graph in graph2 --- | Add some coalesence edges to the graph --- Coalesences between virtual and real regs are recorded as preferences. +-- | Add some coalescence edges to the graph +-- Coalescences between virtual and real regs are recorded as preferences. graphAddCoalesce :: (Reg, Reg) -> Color.Graph VirtualReg RegClass RealReg diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs index 7756030ed8..b8d267801c 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs @@ -109,7 +109,7 @@ worst regsOfClass regAlias neighbors classN classC $ powersetLS regsC -- for each of the subsets of C, the regs which conflict - -- with posiblities for N + -- with possibilities for N regsS_conflict = map (\s -> intersectUniqSets regsN (regAliasS s)) regsS diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs index 274ab3e0be..033a5cd034 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs @@ -109,7 +109,7 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcInteger conflicts excl ArchPPC -> 16 ArchPPC_64 _ -> 15 ArchARM _ _ _ -> panic "trivColorable ArchARM" - -- We should be able to allocate *a lot* more in princple. + -- We should be able to allocate *a lot* more in principle. -- essentially all 32 - SP, so 31, we'd trash the link reg -- as well as the platform and all others though. ArchAArch64 -> 18 @@ -142,7 +142,7 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcFloat conflicts exclus ArchPPC -> 0 ArchPPC_64 _ -> 0 ArchARM _ _ _ -> panic "trivColorable ArchARM" - -- we can in princple address all the float regs as + -- we can in principle address all the float regs as -- segments. So we could have 64 Float regs. Or -- 128 Half regs, or even 256 Byte regs. ArchAArch64 -> 0 diff --git a/compiler/GHC/CmmToAsm/Reg/Linear.hs b/compiler/GHC/CmmToAsm/Reg/Linear.hs index 708290372d..f20326b738 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear.hs @@ -595,7 +595,7 @@ genRaInsn block_live new_instrs block_id instr r_dying w_dying = do -- we need to ensure they are emitted in the correct order. We used to only -- emit single instructions in mkSpill/mkReload/mkRegRegMove. -- As such order of spills and reloads didn't matter. However, with - -- mutliple instructions potentially issued by those functions we need to be + -- multiple instructions potentially issued by those functions we need to be -- careful to not break execution order. Reversing the spills (clobber will -- also spill), will ensure they are emitted in the right order. -- @@ -618,7 +618,7 @@ genRaInsn block_live new_instrs block_id instr r_dying w_dying = do ] -- pprTrace "patched-code" ((vcat $ map (docToSDoc . pprInstr) code)) $ do --- pprTrace "pached-fixup" ((ppr fixup_blocks)) $ do +-- pprTrace "patched-fixup" ((ppr fixup_blocks)) $ do return (code, fixup_blocks) diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs b/compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs index ffe4719f0a..59b958ce1f 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs @@ -35,7 +35,7 @@ import GHC.Stack -- | - Operates on 32-bit | - Separate reg. bank, | - Separate reg. bank, | -- | GP ARM registers | 32x64-bit NEON regs | 32x128-bit NEON regs | -- | - 8-bit/16-bit integer | - 8/16/32/64-bit int | - 8/16/32/64-bit int | --- | | - Single percision fp | - Single percision fp | +-- | | - Single precision fp | - Single precision fp | -- | | | - Double precision fp | -- | | | - Single/Double fp are | -- | | | IEEE compliant | diff --git a/compiler/GHC/CmmToAsm/X86/CodeGen.hs b/compiler/GHC/CmmToAsm/X86/CodeGen.hs index 3c34109c64..9861177c3a 100644 --- a/compiler/GHC/CmmToAsm/X86/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/X86/CodeGen.hs @@ -3068,7 +3068,7 @@ condIntReg cond x y = do -- ja _c2g2 -- jmp _c2g1 -- --- Removing the jump reduces the pressure on the branch predidiction system +-- Removing the jump reduces the pressure on the branch prediction system -- and plays better with the uOP cache. condFltReg :: Bool -> Cond -> CmmExpr -> CmmExpr -> NatM Register diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs index 6a016a4814..c55029175c 100644 --- a/compiler/GHC/CmmToC.hs +++ b/compiler/GHC/CmmToC.hs @@ -130,7 +130,7 @@ pprTop platform = \case -- BasicBlocks are self-contained entities: they always end in a jump. -- -- Like nativeGen/AsmCodeGen, we could probably reorder blocks to turn --- as many jumps as possible into fall throughs. +-- as many jumps as possible into fallthroughs. -- pprBBlock :: Platform -> CmmBlock -> SDoc @@ -853,7 +853,7 @@ pprMachOp_for_C platform mop = case mop of (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ " should have been handled earlier!") - MO_AlignmentCheck {} -> panic "-falignment-santisation not supported by unregisterised backend" + MO_AlignmentCheck {} -> panic "-falignment-sanitisation not supported by unregisterised backend" signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True diff --git a/compiler/GHC/CmmToLlvm/CodeGen.hs b/compiler/GHC/CmmToLlvm/CodeGen.hs index 1ed843854e..ba29185eda 100644 --- a/compiler/GHC/CmmToLlvm/CodeGen.hs +++ b/compiler/GHC/CmmToLlvm/CodeGen.hs @@ -758,7 +758,7 @@ castVars signage vars = do let (vars', stmts) = unzip done return (vars', toOL stmts) --- | Cast an LLVM variable to a specific type, panicing if it can't be done. +-- | Cast an LLVM variable to a specific type, panicking if it can't be done. castVar :: Signage -> LlvmVar -> LlvmType -> LlvmM (LlvmVar, LlvmStatement) castVar signage v t | getVarType v == t = return (v, Nop) diff --git a/compiler/GHC/Core.hs b/compiler/GHC/Core.hs index 4e58df6fc9..664e8cac43 100644 --- a/compiler/GHC/Core.hs +++ b/compiler/GHC/Core.hs @@ -1483,7 +1483,7 @@ unfoldingTemplate :: Unfolding -> CoreExpr unfoldingTemplate = uf_tmpl -- | Retrieves the template of an unfolding if possible --- maybeUnfoldingTemplate is used mainly wnen specialising, and we do +-- maybeUnfoldingTemplate is used mainly when specialising, and we do -- want to specialise DFuns, so it's important to return a template -- for DFunUnfoldings maybeUnfoldingTemplate :: Unfolding -> Maybe CoreExpr diff --git a/compiler/GHC/Core/Coercion.hs b/compiler/GHC/Core/Coercion.hs index dc3f7d277f..15ee9369da 100644 --- a/compiler/GHC/Core/Coercion.hs +++ b/compiler/GHC/Core/Coercion.hs @@ -304,7 +304,7 @@ tidyCoAxBndrsForUser init_env tcvs coToMCo :: Coercion -> MCoercion -- Convert a coercion to a MCoercion, -- It's not clear whether or not isReflexiveCo would be better here --- See #19815 for a bit of data and dicussion on this point +-- See #19815 for a bit of data and discussion on this point coToMCo co | isReflCo co = MRefl | otherwise = MCo co @@ -955,7 +955,7 @@ optCoercion. Not a big deal either way. mkAxInstCo :: Role -> CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Coercion --- mkAxInstCo can legitimately be called over-staturated; +-- mkAxInstCo can legitimately be called over-saturated; -- i.e. with more type arguments than the coercion requires mkAxInstCo role ax index tys cos | arity == n_tys = downgradeRole role ax_role $ @@ -1615,7 +1615,7 @@ mkPiCo :: Role -> Var -> Coercion -> Coercion mkPiCo r v co | isTyVar v = mkHomoForAllCos [v] co | isCoVar v = assert (not (v `elemVarSet` tyCoVarsOfCo co)) $ -- We didn't call mkForAllCo here because if v does not appear - -- in co, the argement coercion will be nominal. But here we + -- in co, the argument coercion will be nominal. But here we -- want it to be r. It is only called in 'mkPiCos', which is -- only used in GHC.Core.Opt.Simplify.Utils, where we are sure for -- now (Aug 2018) v won't occur in co. diff --git a/compiler/GHC/Core/DataCon.hs b/compiler/GHC/Core/DataCon.hs index 887a293e88..d8b26558aa 100644 --- a/compiler/GHC/Core/DataCon.hs +++ b/compiler/GHC/Core/DataCon.hs @@ -232,7 +232,7 @@ in wrapper_reqd in GHC.Types.Id.Make.mkDataConRep. data T = MkT !(Int,Int) \$wMkT :: (Int,Int) -> T \$wMkT (x,y) = MkT x y - Notice that the worker has two fields where the wapper has + Notice that the worker has two fields where the wrapper has just one. That is, the worker has type MkT :: Int -> Int -> T diff --git a/compiler/GHC/Core/FamInstEnv.hs b/compiler/GHC/Core/FamInstEnv.hs index c4ff9ee1f7..60e2c90a2a 100644 --- a/compiler/GHC/Core/FamInstEnv.hs +++ b/compiler/GHC/Core/FamInstEnv.hs @@ -366,7 +366,7 @@ type FamInstEnvs = (FamInstEnv, FamInstEnv) data FamInstEnv = FamIE !Int -- The number of instances, used to choose the smaller environment - -- when checking type family consistnecy of home modules. + -- when checking type family consistency of home modules. !(RoughMap FamInst) -- See Note [FamInstEnv] -- See Note [FamInstEnv determinism] @@ -549,7 +549,7 @@ data InjectivityCheckResult | InjectivityUnified CoAxBranch CoAxBranch -- ^ RHSs unify but LHSs don't unify under that substitution. Relevant for -- closed type families where equation after unification might be - -- overlpapped (in which case it is OK if they don't unify). Constructor + -- overlapped (in which case it is OK if they don't unify). Constructor -- stores axioms after unification. -- | Check whether two type family axioms don't violate injectivity annotation. @@ -920,7 +920,7 @@ See also Note [Injective type families] in GHC.Core.TyCon lookupFamInstEnvInjectivityConflicts :: [Bool] -- injectivity annotation for this type family instance -- INVARIANT: list contains at least one True value - -> FamInstEnvs -- all type instances seens so far + -> FamInstEnvs -- all type instances seen so far -> FamInst -- new type instance that we're checking -> [CoAxBranch] -- conflicting instance declarations lookupFamInstEnvInjectivityConflicts injList fam_inst_envs diff --git a/compiler/GHC/Core/InstEnv.hs b/compiler/GHC/Core/InstEnv.hs index 45ecd4f2b5..53d7077e61 100644 --- a/compiler/GHC/Core/InstEnv.hs +++ b/compiler/GHC/Core/InstEnv.hs @@ -1059,7 +1059,7 @@ that overrides it) but might still be useful for eliminating other instances A2. M is not overlapping, A3. G is overlapping. - This means that we eliminate G from the set of matches (it is overriden by M), + This means that we eliminate G from the set of matches (it is overridden by M), but we keep it around until we are done with instance resolution because it might still be useful to eliminate other matches. @@ -1067,7 +1067,7 @@ that overrides it) but might still be useful for eliminating other instances There are two situations in which guards can eliminate a match: - B1. We want to add a new instance, but it is overriden by a guard. + B1. We want to add a new instance, but it is overridden by a guard. We can immediately discard the instance. Example for B1: @@ -1080,7 +1080,7 @@ that overrides it) but might still be useful for eliminating other instances Processing them in order: we add J1 as a match, then J2 as a guard. Now, when we come across J3, we can immediately discard it because - it is overriden by the guard J2. + it is overridden by the guard J2. B2. We have found a new guard. We must use it to discard matches we have already found. This is necessary because we must obtain @@ -1096,7 +1096,7 @@ that overrides it) but might still be useful for eliminating other instances We start by considering K1 and K2. Neither has any overlapping flag set, so we end up with two matches, {K1, K2}. - Next we look at K3: it is overriden by K1, but as K1 is not + Next we look at K3: it is overridden by K1, but as K1 is not overlapping this means K3 should function as a guard. We must then ensure we eliminate K2 from the list of matches, as K3 guards against it. diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs index e375be5340..ce0e83669f 100644 --- a/compiler/GHC/Core/Lint.hs +++ b/compiler/GHC/Core/Lint.hs @@ -187,7 +187,7 @@ in GHC.Core.Opt.WorkWrap.Utils. (Maybe there are other "clients" of this featur (SI2) The result of that substitution is used only to check for type equality, to check well-typed-ness, /but is then discarded/. - The result of substittion does not outlive the CoreLint pass. + The result of substitution does not outlive the CoreLint pass. (SI3) The InScopeSet of le_subst includes only TyVar and CoVar binders. @@ -2079,7 +2079,7 @@ lintCoercion (CoVarCo cv) -> return (CoVarCo cv) | otherwise -> - -- lintCoBndr always extends the substitition + -- lintCoBndr always extends the substitution failWithL $ hang (text "The coercion variable" <+> pprBndr LetBind cv) 2 (text "is out of scope") diff --git a/compiler/GHC/Core/Make.hs b/compiler/GHC/Core/Make.hs index 9c927b509c..8039924051 100644 --- a/compiler/GHC/Core/Make.hs +++ b/compiler/GHC/Core/Make.hs @@ -105,7 +105,7 @@ infixl 4 `mkCoreApp`, `mkCoreApps` -- | Sort the variables, putting type and covars first, in scoped order, -- and then other Ids -- --- It is a deterministic sort, meaining it doesn't look at the values of +-- It is a deterministic sort, meaning it doesn't look at the values of -- Uniques. For explanation why it's important See Note [Unique Determinism] -- in GHC.Types.Unique. sortQuantVars :: [Var] -> [Var] @@ -467,7 +467,7 @@ unitExpr = Var unitDataConId ************************************************************************ -} --- | Builds a selector which scrutises the given +-- | Builds a selector which scrutinises the given -- expression and extracts the one name from the list given. -- If you want the no-shadowing rule to apply, the caller -- is responsible for making sure that none of these names diff --git a/compiler/GHC/Core/Multiplicity.hs b/compiler/GHC/Core/Multiplicity.hs index b3c268c356..9d95cb4f9c 100644 --- a/compiler/GHC/Core/Multiplicity.hs +++ b/compiler/GHC/Core/Multiplicity.hs @@ -132,7 +132,7 @@ for u to typecheck. Usages are usually group in a UsageEnv, as defined in the UsageEnv module. So, in our function application example, the typechecking algorithm would -receive usage environements f_ue from the typechecking of f, and u_ue from the +receive usage environments f_ue from the typechecking of f, and u_ue from the typechecking of u. Then the output would be f_ue + (k * u_ue). Addition and scaling of usage environment is the pointwise extension of the semiring operations on multiplicities. diff --git a/compiler/GHC/Core/Opt/Arity.hs b/compiler/GHC/Core/Opt/Arity.hs index b03fe84b14..c9142443c1 100644 --- a/compiler/GHC/Core/Opt/Arity.hs +++ b/compiler/GHC/Core/Opt/Arity.hs @@ -571,7 +571,7 @@ Extrude the g2 f' = \p. \s. ((error "...") |> g1) s f = f' |> (String -> g2) -Discard args for bottomming function +Discard args for bottoming function f' = \p. \s. ((error "...") |> g1 |> g3 g3 :: (S -> (S,T)) ~ (S,T) @@ -823,7 +823,7 @@ arityTypeOneShots (AT lams _) = map snd lams safeArityType :: ArityType -> SafeArityType -- ^ Assuming this ArityType is all we know, find the arity of --- the function, and trim the argument info (and Divergenge) +-- the function, and trim the argument info (and Divergence) -- to match that arity. See Note [SafeArityType] safeArityType at@(AT lams _) = case go 0 IsCheap lams of @@ -2034,7 +2034,7 @@ This what eta_expand does. We do it in two steps: where etas :: EtaInfo etaInfoAbs builds the lambdas - etaInfoApp builds the applictions + etaInfoApp builds the applications Note that the /same/ EtaInfo drives both etaInfoAbs and etaInfoApp @@ -2391,7 +2391,7 @@ case where `e` is trivial): when `e = \x. if x then bot else id`, because the latter will diverge when the former would not. - On the other hand, with `-fno-pendantic-bottoms` , we will have eta-expanded + On the other hand, with `-fno-pedantic-bottoms` , we will have eta-expanded the definition of `e` and then eta-reduction is sound (see Note [Dealing with bottom]). Consequence: We have to check that `-fpedantic-bottoms` is off; otherwise @@ -2487,7 +2487,7 @@ HOWEVER, if we transform that might mean that f isn't saturated any more, and does not inline. This led to some other regressions. -TL;DR currrently we do /not/ eta reduce if the result is a PAP. +TL;DR currently we do /not/ eta reduce if the result is a PAP. Note [Eta reduction with casted arguments] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/GHC/Core/Opt/CSE.hs b/compiler/GHC/Core/Opt/CSE.hs index 23baf90742..ff1bd3782e 100644 --- a/compiler/GHC/Core/Opt/CSE.hs +++ b/compiler/GHC/Core/Opt/CSE.hs @@ -144,7 +144,7 @@ even though we /also/ carry a substitution x -> y. Can we just drop the binding instead? Well, not at top level! See Note [Top level and postInlineUnconditionally] in GHC.Core.Opt.Simplify.Utils; and in any case CSE applies only to the /bindings/ of the program, and we leave -it to the simplifier to propate effects to the RULES. Finally, it +it to the simplifier to propagate effects to the RULES. Finally, it doesn't seem worth the effort to discard the nested bindings because the simplifier will do it next. @@ -356,7 +356,7 @@ the program; it's a kind of synthetic key for recursive bindings. Note [Separate envs for let rhs and body] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Substituting occurances of the binder in the rhs with the +Substituting occurrences of the binder in the rhs with the renamed binder is wrong for non-recursive bindings. Why? Consider this core. diff --git a/compiler/GHC/Core/Opt/CallArity.hs b/compiler/GHC/Core/Opt/CallArity.hs index 306b3bd446..265c4fb57e 100644 --- a/compiler/GHC/Core/Opt/CallArity.hs +++ b/compiler/GHC/Core/Opt/CallArity.hs @@ -150,7 +150,7 @@ The interesting cases of the analysis: any useful co-call information. Return (fv e)² * Case alternatives alt₁,alt₂,...: - Only one can be execuded, so + Only one can be executed, so Return (alt₁ ∪ alt₂ ∪...) * App e₁ e₂ (and analogously Case scrut alts), with non-trivial e₂: We get the results from both sides, with the argument evaluated at most once. @@ -277,7 +277,7 @@ together with what other functions. Note [Analysis type signature] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The work-hourse of the analysis is the function `callArityAnal`, with the +The workhorse of the analysis is the function `callArityAnal`, with the following type: type CallArityRes = (UnVarGraph, VarEnv Arity) diff --git a/compiler/GHC/Core/Opt/ConstantFold.hs b/compiler/GHC/Core/Opt/ConstantFold.hs index 14d5c88262..8a22124779 100644 --- a/compiler/GHC/Core/Opt/ConstantFold.hs +++ b/compiler/GHC/Core/Opt/ConstantFold.hs @@ -1288,7 +1288,7 @@ word64Result' :: Integer -> CoreExpr word64Result' result = Lit (mkLitWord64Wrap result) --- | 'ambiant (primop x) = x', but not nececesarily 'primop (ambient x) = x'. +-- | 'ambient (primop x) = x', but not necessarily 'primop (ambient x) = x'. semiInversePrimOp :: PrimOp -> RuleM CoreExpr semiInversePrimOp primop = do [Var primop_id `App` e] <- getArgs @@ -2909,7 +2909,7 @@ mulFoldingRules' platform arg1 arg2 num_ops = case (arg1,arg2) of andFoldingRules' :: Platform -> CoreExpr -> CoreExpr -> NumOps -> Maybe CoreExpr andFoldingRules' platform arg1 arg2 num_ops = case (arg1, arg2) of - -- R2) * `or` `and` simplications + -- R2) * `or` `and` simplifications -- l1 and (l2 and x) ==> (l1 and l2) and x (L l1, is_lit_and num_ops -> Just (l2, x)) -> Just (mkL (l1 .&. l2) `and` x) @@ -2932,7 +2932,7 @@ andFoldingRules' platform arg1 arg2 num_ops = case (arg1, arg2) of orFoldingRules' :: Platform -> CoreExpr -> CoreExpr -> NumOps -> Maybe CoreExpr orFoldingRules' platform arg1 arg2 num_ops = case (arg1, arg2) of - -- R2) * `or` `and` simplications + -- R2) * `or` `and` simplifications -- l1 or (l2 or x) ==> (l1 or l2) or x (L l1, is_lit_or num_ops -> Just (l2, x)) -> Just (mkL (l1 .|. l2) `or` x) diff --git a/compiler/GHC/Core/Opt/DmdAnal.hs b/compiler/GHC/Core/Opt/DmdAnal.hs index bf1870c3ea..011f02af5f 100644 --- a/compiler/GHC/Core/Opt/DmdAnal.hs +++ b/compiler/GHC/Core/Opt/DmdAnal.hs @@ -362,7 +362,7 @@ dmdAnalStar env (n :* sd) e -- and Note [Analysing with absent demand] = (toPlusDmdArg $ multDmdType n' dmd_ty, e') --- Main Demand Analsysis machinery +-- Main Demand Analysis machinery dmdAnal, dmdAnal' :: AnalEnv -> SubDemand -- The main one takes a *SubDemand* -> CoreExpr -> WithDmdType CoreExpr @@ -1440,7 +1440,7 @@ encoded in the demand signature, because that is the information that demand analysis propagates throughout the program. Failing to implement the strategy laid out in the signature can result in reboxing in unexpected places. Hence, we must completely anticipate -unboxing decisions during demand analysis and reflect these decicions +unboxing decisions during demand analysis and reflect these decisions in demand annotations. That is the job of 'finaliseArgBoxities', which is defined here and called from demand analysis. @@ -1460,8 +1460,8 @@ Note [Finalising boxity for let-bound Ids] Consider let x = e in body where the demand on 'x' is 1!P(blah). We want to unbox x according to -Note [Thunk splitting] in GHC.Core.Opt.WorkWrap. We must do this becuase -worker/wrapper ignores stricness and looks only at boxity flags; so if +Note [Thunk splitting] in GHC.Core.Opt.WorkWrap. We must do this because +worker/wrapper ignores strictness and looks only at boxity flags; so if x's demand is L!P(blah) we might still split it (wrongly). We want to switch to Boxed on any lazy demand. @@ -1933,7 +1933,7 @@ There are two reasons we sometimes trim a demand to match a type. 1. GADTs 2. Recursive products and widening -More on both below. But the botttom line is: we really don't want to +More on both below. But the bottom line is: we really don't want to have a binder whose demand is more deeply-nested than its type "allows". So in findBndrDmd we call trimToType and findTypeShape to trim the demand on the binder to a form that matches the type @@ -1956,7 +1956,7 @@ For (2) consider f _ (MkT n t) = f n t Here f is lazy in T, but its *usage* is infinite: P(L,P(L,P(L, ...))). -Notice that this happens because T is a product type, and is recrusive. +Notice that this happens because T is a product type, and is recursive. If we are not careful, we'll fail to iterate to a fixpoint in dmdFix, and bale out entirely, which is inefficient and over-conservative. @@ -2238,7 +2238,7 @@ The Opt_DictsStrict flag makes GHC use call-by-value for dictionaries. Why? * Generally CBV is more efficient. * Dictionaries are always non-bottom; and never take much work to - compute. E.g. a dfun from an instance decl always returns a dicionary + compute. E.g. a dfun from an instance decl always returns a dictionary record immediately. See DFunUnfolding in CoreSyn. See also Note [Recursive superclasses] in TcInstDcls. @@ -2254,7 +2254,7 @@ The Opt_DictsStrict flag makes GHC use call-by-value for dictionaries. Why? See #17758 for more background and perf numbers. -The implementation is extremly simple: just make the strictness +The implementation is extremely simple: just make the strictness analyser strictify the demand on a dictionary binder in 'findBndrDmd'. diff --git a/compiler/GHC/Core/Opt/Exitify.hs b/compiler/GHC/Core/Opt/Exitify.hs index ac4df91f97..89156418bc 100644 --- a/compiler/GHC/Core/Opt/Exitify.hs +++ b/compiler/GHC/Core/Opt/Exitify.hs @@ -306,7 +306,7 @@ Neither do we want this to happen in … where the floated expression `x+x` is a bit more complicated, but still not -intersting. +interesting. Expressions are interesting when they move an occurrence of a variable outside the recursive `go` that can benefit from being obviously called once, for example: @@ -315,7 +315,7 @@ the recursive `go` that can benefit from being obviously called once, for exampl see that it is called at most once, and hence improve the function’s strictness signature -So we only hoist an exit expression out if it mentiones at least one free, +So we only hoist an exit expression out if it mentions at least one free, non-imported variable. Note [Jumps can be interesting] @@ -430,7 +430,7 @@ would). To prevent this, we need to recognize exit join points, and then disable inlining. -Exit join points, recognizeable using `isExitJoinId` are join points with an +Exit join points, recognizable using `isExitJoinId` are join points with an occurrence in a recursive group, and can be recognized (after the occurrence analyzer ran!) using `isExitJoinId`. This function detects joinpoints with `occ_in_lam (idOccinfo id) == True`, diff --git a/compiler/GHC/Core/Opt/FloatOut.hs b/compiler/GHC/Core/Opt/FloatOut.hs index b6ee3691c8..8c2961d21f 100644 --- a/compiler/GHC/Core/Opt/FloatOut.hs +++ b/compiler/GHC/Core/Opt/FloatOut.hs @@ -343,7 +343,7 @@ Note [floatBind for top level] We may have a *nested* binding whose destination level is (FloatMe tOP_LEVEL), thus letrec { foo <0,0> = .... (let bar<0,0> = .. in ..) .... } The binding for bar will be in the "tops" part of the floating binds, -and thus not partioned by floatBody. +and thus not partitioned by floatBody. We could perhaps get rid of the 'tops' component of the floating binds, but this case works just as well. diff --git a/compiler/GHC/Core/Opt/OccurAnal.hs b/compiler/GHC/Core/Opt/OccurAnal.hs index a4218df867..4a67b8cdea 100644 --- a/compiler/GHC/Core/Opt/OccurAnal.hs +++ b/compiler/GHC/Core/Opt/OccurAnal.hs @@ -788,7 +788,7 @@ occAnalNonRecBind !env lvl imp_rule_edges bndr rhs body_usage -- h = ... -- g = ... -- RULE map g = h - -- Then we want to ensure that h is in scope everwhere + -- Then we want to ensure that h is in scope everywhere -- that g is (since the RULE might turn g into h), so -- we make g mention h. @@ -958,7 +958,7 @@ And now the Simplifer will try to use PreInlineUnconditionally on lvl1 (which occurs just once), but because it is last we won't actually substitute in lvl2. Sigh. -To avoid this possiblity, we include edges from lvl2 to /both/ its +To avoid this possibility, we include edges from lvl2 to /both/ its stable unfolding /and/ its RHS. Hence the defn of inl_fvs in makeNode. Maybe we could be more clever, but it's very much a corner case. @@ -1222,7 +1222,7 @@ more likely. Here's a real example from #1969: $s$dm2 = \x. op dBool } The RULES stuff means that we can't choose $dm as a loop breaker (Note [Choosing loop breakers]), so we must choose at least (say) -opInt *and* opBool, and so on. The number of loop breakders is +opInt *and* opBool, and so on. The number of loop breakers is linear in the number of instance declarations. Note [Loop breakers and INLINE/INLINABLE pragmas] @@ -2404,10 +2404,10 @@ A': Non-obviously saturated applications: eg build (f (\x y -> expensive)) B: Let-bindings: eg let f = \c. let ... in \n -> blah in (build f, build f) - Propagate one-shot info from the demanand-info on 'f' to the + Propagate one-shot info from the demand-info on 'f' to the lambdas in its RHS (which may not be syntactically at the top) - This information must have come from a previous run of the demanand + This information must have come from a previous run of the demand analyser. Previously, the demand analyser would *also* set the one-shot information, but @@ -2550,7 +2550,7 @@ addOneInScope env@(OccEnv { occ_bs_env = swap_env, occ_bs_rng = rng_vars }) bndr addInScope :: OccEnv -> [Var] -> OccEnv -- See Note [The binder-swap substitution] --- It's only neccessary to call this on in-scope Ids, +-- It's only necessary to call this on in-scope Ids, -- but harmless to include TyVars too addInScope env@(OccEnv { occ_bs_env = swap_env, occ_bs_rng = rng_vars }) bndrs | any (`elemVarSet` rng_vars) bndrs = env { occ_bs_env = emptyVarEnv, occ_bs_rng = emptyVarSet } diff --git a/compiler/GHC/Core/Opt/Pipeline.hs b/compiler/GHC/Core/Opt/Pipeline.hs index bbf0dc2164..28871d9fb7 100644 --- a/compiler/GHC/Core/Opt/Pipeline.hs +++ b/compiler/GHC/Core/Opt/Pipeline.hs @@ -244,7 +244,7 @@ getCoreToDo dflags rule_base extra_vars -- GHC.Iface.Tidy.StaticPtrTable. static_ptrs_float_outwards, - -- Run the simplier phases 2,1,0 to allow rewrite rules to fire + -- Run the simplifier phases 2,1,0 to allow rewrite rules to fire runWhen do_simpl3 (CoreDoPasses $ [ simpl_phase (Phase phase) "main" max_iter | phase <- [phases, phases-1 .. 1] ] ++ @@ -417,7 +417,7 @@ for two reasons, both shown up in test perf/compiler/T16473, with -O2 -flate-specialise 1. I found that running late-Specialise after SpecConstr, with no - simplification in between meant that the carefullly constructed + simplification in between meant that the carefully constructed SpecConstr rule never got to fire. (It was something like lvl = f a -- Arity 1 ....g lvl.... diff --git a/compiler/GHC/Core/Opt/SetLevels.hs b/compiler/GHC/Core/Opt/SetLevels.hs index 9645a10340..1d811b12cf 100644 --- a/compiler/GHC/Core/Opt/SetLevels.hs +++ b/compiler/GHC/Core/Opt/SetLevels.hs @@ -772,7 +772,7 @@ But do not do so if (saves_alloc): - the expression is not a HNF, and - the expression is not bottoming -Exammples: +Examples: * Bottoming f x = case x of @@ -945,7 +945,7 @@ But, as ever, we need to be careful: Example: ... let { v = \y. error (show x ++ show y) } in ... We want to abstract over x and float the whole thing to top: - lvl = \xy. errror (show x ++ show y) + lvl = \xy. error (show x ++ show y) ...let {v = lvl x} in ... Then of course we don't want to separately float the body (error ...) diff --git a/compiler/GHC/Core/Opt/Simplify/Env.hs b/compiler/GHC/Core/Opt/Simplify/Env.hs index cd3548781a..6409a6d7eb 100644 --- a/compiler/GHC/Core/Opt/Simplify/Env.hs +++ b/compiler/GHC/Core/Opt/Simplify/Env.hs @@ -468,7 +468,7 @@ seIdSubst: binding site. * The in-scope "set" usually maps x->x; we use it simply for its domain. - But sometimes we have two in-scope Ids that are synomyms, and should + But sometimes we have two in-scope Ids that are synonyms, and should map to the same target: x->x, y->x. Notably: case y of x { ... } That's why the "set" is actually a VarEnv Var @@ -1160,7 +1160,7 @@ simplJoinBndr mult res_ty env id adjustJoinPointType :: Mult -> Type -- New result type -> Id -- Old join-point Id - -> Id -- Adjusted jont-point Id + -> Id -- Adjusted join-point Id -- (adjustJoinPointType mult new_res_ty join_id) does two things: -- -- 1. Set the return type of the join_id to new_res_ty diff --git a/compiler/GHC/Core/Opt/Simplify/Utils.hs b/compiler/GHC/Core/Opt/Simplify/Utils.hs index 433c67b35a..5e5fb8bc52 100644 --- a/compiler/GHC/Core/Opt/Simplify/Utils.hs +++ b/compiler/GHC/Core/Opt/Simplify/Utils.hs @@ -320,7 +320,7 @@ data ArgInfo -- that the function diverges after being given -- that number of args - ai_discs :: [Int] -- Discounts for remaining value arguments (beyong ai_args) + ai_discs :: [Int] -- Discounts for remaining value arguments (beyond ai_args) -- non-zero => be keener to inline -- Always infinite } @@ -2001,7 +2001,7 @@ new binding is abstracted. Note that mentioned in the abstracted body. This means: - they are automatically in dependency order, because main_tvs is - there is no issue about non-determinism - - we don't gratuitiously change order, which may help (in a tiny + - we don't gratuitously change order, which may help (in a tiny way) with CSE and/or the compiler-debugging experience -} @@ -2229,7 +2229,7 @@ Note [Merge Nested Cases] } which merges two cases in one case when -- the default alternative of -the outer case scrutises the same variable as the outer case. This +the outer case scrutinises the same variable as the outer case. This transformation is called Case Merging. It avoids that the same variable is scrutinised multiple times. @@ -2500,7 +2500,7 @@ Since the case is exhaustive (all cases are) we can convert it to DEFAULT -> e1 1# -> e2 -This may generate sligthtly better code (although it should not, since +This may generate slightly better code (although it should not, since all cases are exhaustive) and/or optimise better. I'm not certain that it's necessary, but currently we do make this change. We do it here, NOT in the TagToEnum rules (see "Beware" in Note [caseRules for tagToEnum] diff --git a/compiler/GHC/Core/Opt/SpecConstr.hs b/compiler/GHC/Core/Opt/SpecConstr.hs index 2eb5862039..538b457ffc 100644 --- a/compiler/GHC/Core/Opt/SpecConstr.hs +++ b/compiler/GHC/Core/Opt/SpecConstr.hs @@ -2011,7 +2011,7 @@ type argument giving us: But if you look closely this wouldn't typecheck! If we substitute `f True` with `$sf void#` we expect the type argument to be applied first but we apply void# first. -The easist fix seems to be just to add the void argument to the front of the arguments. +The easiest fix seems to be just to add the void argument to the front of the arguments. Now we get: $sf :: Void# -> forall t. bla $sf void @t = $se @@ -2052,7 +2052,7 @@ calcSpecInfo :: Id -- The original function -> ( [Var] -- Demand-decorated binders , DmdSig -- Strictness of specialised thing , Arity, Maybe JoinArity ) -- Arities of specialised thing --- Calcuate bits of IdInfo for the specialised function +-- Calculate bits of IdInfo for the specialised function -- See Note [Transfer strictness] -- See Note [Strictness information in worker binders] calcSpecInfo fn (CP { cp_qvars = qvars, cp_args = pats }) extra_bndrs @@ -2593,7 +2593,7 @@ argToPat1 env in_scope val_env arg arg_occ _arg_str , Just arg_occs <- mb_scrut dc = do { let (ty_args, rest_args) = splitAtList (dataConUnivTyVars dc) args con_str, matched_str :: [StrictnessMark] - -- con_str corrresponds 1-1 with the /value/ arguments + -- con_str corresponds 1-1 with the /value/ arguments -- matched_str corresponds 1-1 with /all/ arguments con_str = dataConRepStrictness dc matched_str = match_vals con_str rest_args diff --git a/compiler/GHC/Core/Opt/WorkWrap.hs b/compiler/GHC/Core/Opt/WorkWrap.hs index 30d4993abc..27d85d0545 100644 --- a/compiler/GHC/Core/Opt/WorkWrap.hs +++ b/compiler/GHC/Core/Opt/WorkWrap.hs @@ -486,7 +486,7 @@ Reminder: Note [Don't w/w INLINE things], so we don't need to worry about INLINE things here. -What if `foo` has no specialiations, is worker/wrappered (with the +What if `foo` has no specialisations, is worker/wrappered (with the wrapper inlining very early), and exported; and then in an importing module we have {-# SPECIALISE foo : ... #-}? @@ -645,7 +645,7 @@ as simple as I thought. Consider this: in p `seq` (v,v) I think we'll give `f` the strictness signature `<SP(M,A)>`, where the -`M` sayd that we'll evaluate the first component of the pair at most +`M` says that we'll evaluate the first component of the pair at most once. Why? Because the RHS of the thunk `v` is evaluated at most once. diff --git a/compiler/GHC/Core/Opt/WorkWrap/Utils.hs b/compiler/GHC/Core/Opt/WorkWrap/Utils.hs index 1fc05737f1..5b653e751f 100644 --- a/compiler/GHC/Core/Opt/WorkWrap/Utils.hs +++ b/compiler/GHC/Core/Opt/WorkWrap/Utils.hs @@ -524,7 +524,7 @@ reference the wrong, inner a. A similar situation occurred in #12562, we even saw a type variable in the worker shadowing an outer term-variable binding. We avoid the issue by freshening the argument variables from the original fun -RHS through 'cloneBndrs', which will also take care of subsitution in binder +RHS through 'cloneBndrs', which will also take care of substitution in binder types. Fortunately, it's sufficient to pick the FVs of the arg vars as in-scope set, so that we don't need to do a FV traversal over the whole body of the original function. @@ -717,7 +717,7 @@ mkWWcpr. But we still want to emit warning with -DDEBUG, to hopefully catch other cases where something went avoidably wrong. This warning also triggers for the stream fusion library within `text`. -We can'easily W/W constructed results like `Stream` because we have no simple +We can't easily W/W constructed results like `Stream` because we have no simple way to express existential types in the worker's type signature. Note [WW for calling convention] @@ -741,7 +741,7 @@ of work. Performing W/W might not always be a win. In particular it's easy to break (badly written, but common) rule frameworks by doing additional W/W splits. -See #20364 for a more detailed explaination. +See #20364 for a more detailed explanation. Hence we have the following strategies with different trade-offs: @@ -751,7 +751,7 @@ A) Never do W/W *just* for unlifting of arguments. B) Do W/W on just about anything where it might be beneficial. - + Exploits pretty much every oppertunity for unlifting. + + Exploits pretty much every opportunity for unlifting. - A bit of compile time/code size cost for all the wrappers. - Can break rules which would otherwise fire. See #20364. @@ -764,7 +764,7 @@ C) Unlift *any* (non-boot exported) functions arguments if they are strict. - Requires either: ~ Eta-expansion at *all* call sites in order to generate an impedance matcher function. Leading to massive code bloat. - Essentially we end up creating a imprompto wrapper function + Essentially we end up creating a impromptu wrapper function wherever we wouldn't inline the wrapper with a W/W approach. ~ There is the option of achieving this without eta-expansion if we instead expand the partial application code to check for demands on the calling convention and @@ -864,7 +864,7 @@ mkWWstr opts args str_marks , args1 ++ args2 , wrap_fn1 . wrap_fn2 , wrap_arg:wrap_args ) } - go _ _ = panic "mkWWstr: Impossible - str/arg length missmatch" + go _ _ = panic "mkWWstr: Impossible - str/arg length mismatch" ---------------------- -- mkWWstr_one wrap_var = (useful, work_args, wrap_fn, wrap_arg) @@ -909,7 +909,7 @@ mkWWstr_one opts arg str_mark = fam_envs = wo_fam_envs opts arg_ty = idType arg arg_dmd = idDemandInfo arg - arg_str | isTyVar arg = NotMarkedStrict -- Type args don't get stricness marks + arg_str | isTyVar arg = NotMarkedStrict -- Type args don't get strictness marks | otherwise = str_mark do_nothing = return (badWorker, [(arg,arg_str)], nop_fn, varToCoreExpr arg) @@ -1291,7 +1291,7 @@ combineIRDCRs = foldl' combineIRDCR NonRecursiveOrUnsure -- through one of @dc@'s fields (so surely non-recursive). -- * @NonRecursiveOrUnsure@ when @fuel /= Infinity@ -- and @fuel@ expansions of nested data TyCons were not enough to prove --- non-recursivenss, nor arrive at an occurrence of @tc@ thus proving +-- non-recursiveness, nor arrive at an occurrence of @tc@ thus proving -- recursiveness. (So not sure if non-recursive.) -- * @NonRecursiveOrUnsure@ when we hit an abstract TyCon (one without -- visible DataCons), such as those imported from .hs-boot files. @@ -1595,7 +1595,7 @@ return unboxed instead of in an unboxed singleton tuple: We want `$wh :: Int# -> [Int]`. We'd get `$wh :: Int# -> (# [Int] #)`. -By considering vars as unlifted that satsify 'exprIsHNF', we catch (3). +By considering vars as unlifted that satisfy 'exprIsHNF', we catch (3). Why not check for 'exprOkForSpeculation'? Quite perplexingly, evaluated vars are not ok-for-spec, see Note [exprOkForSpeculation and evaluated variables]. For (1) and (2) we would have to look at the term. WW only looks at the @@ -1607,7 +1607,7 @@ Note [Linear types and CPR] Remark on linearity: in both the case of the wrapper and the worker, we build a linear case to unpack constructed products. All the multiplicity information is kept in the constructors (both C and (#, #)). -In particular (#,#) is parametrised by the multiplicity of its fields. +In particular (#,#) is parameterised by the multiplicity of its fields. Specifically, in this instance, the multiplicity of the fields of (#,#) is chosen to be the same as those of C. diff --git a/compiler/GHC/Core/Opt/simplifier.tib b/compiler/GHC/Core/Opt/simplifier.tib index e0f9dc91f2..07127c7fe2 100644 --- a/compiler/GHC/Core/Opt/simplifier.tib +++ b/compiler/GHC/Core/Opt/simplifier.tib @@ -706,7 +706,7 @@ each iteration of Step 2 only performs one transformation, then the entire program will to be re-analysed by Step 1, and re-traversed by Step 2, for each transformation of the sequence. Sometimes this is unavoidable, but it is often possible to perform a sequence of -transformtions in a single pass. +transformations in a single pass. The key function, which simplifies expressions, has the following type: @ diff --git a/compiler/GHC/Core/PatSyn.hs b/compiler/GHC/Core/PatSyn.hs index cc66b1caf5..efcc45a772 100644 --- a/compiler/GHC/Core/PatSyn.hs +++ b/compiler/GHC/Core/PatSyn.hs @@ -378,7 +378,7 @@ instance Data.Data PatSyn where -- | Build a new pattern synonym mkPatSyn :: Name -> Bool -- ^ Is the pattern synonym declared infix? - -> ([InvisTVBinder], ThetaType) -- ^ Universially-quantified type + -> ([InvisTVBinder], ThetaType) -- ^ Universally-quantified type -- variables and required dicts -> ([InvisTVBinder], ThetaType) -- ^ Existentially-quantified type -- variables and provided dicts diff --git a/compiler/GHC/Core/RoughMap.hs b/compiler/GHC/Core/RoughMap.hs index 30145ee544..2dc7f6954d 100644 --- a/compiler/GHC/Core/RoughMap.hs +++ b/compiler/GHC/Core/RoughMap.hs @@ -149,7 +149,7 @@ The lookupRM' function returns a pair of potential /matches/ and potential /unif The potential matches is likely to be much smaller than the bag of potential unifiers due to the reasoning about rigid type variables described in Note [Matching a RoughMap]. On the other hand, the instances captured by the RML_NoKnownTC case can still potentially unify -with any instance (depending on the substituion of said rigid variable) so they can't be discounted +with any instance (depending on the substitution of said rigid variable) so they can't be discounted from the list of potential unifiers. This is achieved by the RML_NoKnownTC case continuing the lookup for unifiers by replacing RML_NoKnownTC with RML_LookupOtherTC. @@ -315,7 +315,7 @@ lookupRM tcs rm = bagToList (fst $ lookupRM' tcs rm) -- | N.B. Returns a 'Bag' for matches, which allows us to avoid rebuilding all of the lists -- we find in 'rm_empty', which would otherwise be necessary due to '++' if we --- returned a list. We use a list for unifiers becuase the tail is computed lazily and +-- returned a list. We use a list for unifiers because the tail is computed lazily and -- we often only care about the first couple of potential unifiers. Constructing a -- bag forces the tail which performs much too much work. -- diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs index 8d5fd9422c..232f7cb9cf 100644 --- a/compiler/GHC/Core/Subst.hs +++ b/compiler/GHC/Core/Subst.hs @@ -192,7 +192,7 @@ lookupIdSubst (Subst in_scope ids _ _) v | Just v' <- lookupInScope in_scope v = Var v' -- Vital! See Note [Extending the IdSubstEnv] -- If v isn't in the InScopeSet, we panic, because - -- it's a bad bug and we reallly want to know + -- it's a bad bug and we really want to know | otherwise = pprPanic "lookupIdSubst" (ppr v $$ ppr in_scope) delBndr :: Subst -> Var -> Subst diff --git a/compiler/GHC/Core/TyCo/FVs.hs b/compiler/GHC/Core/TyCo/FVs.hs index b40d930b3c..366f3b8efe 100644 --- a/compiler/GHC/Core/TyCo/FVs.hs +++ b/compiler/GHC/Core/TyCo/FVs.hs @@ -219,7 +219,7 @@ kind are free. * * ********************************************************************* -} -{- Note [Acumulating parameter free variables] +{- Note [Accumulating parameter free variables] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We can use foldType to build an accumulating-parameter version of a free-var finder, thus: @@ -254,7 +254,7 @@ The "strict in the accumulator" part is to ensure that in the AppTy equation we don't build a thunk for (fvs env t2 acc). The optimiser does do all this, but not very robustly. It depends -critially on the basic arity-2 function not being exported, so that +critically on the basic arity-2 function not being exported, so that all its calls are visibly to three arguments. This analysis is done by the Call Arity pass. diff --git a/compiler/GHC/Core/TyCo/Rep.hs b/compiler/GHC/Core/TyCo/Rep.hs index 84f4428a41..f743dddc8b 100644 --- a/compiler/GHC/Core/TyCo/Rep.hs +++ b/compiler/GHC/Core/TyCo/Rep.hs @@ -569,7 +569,7 @@ Accordingly, by eliminating reflexive casts, splitTyConApp need not worry about outermost casts to uphold (EQ). Eliminating reflexive casts is done in mkCastTy. This is (EQ1) below. -Unforunately, that's not the end of the story. Consider comparing +Unfortunately, that's not the end of the story. Consider comparing (T a b c) =? (T a b |> (co -> <Type>)) (c |> co) These two types have the same kind (Type), but the left type is a TyConApp while the right type is not. To handle this case, we say that the right-hand @@ -1720,7 +1720,7 @@ the evidence for unboxed equalities: holes are easier. - Moreover, nothing is lost from the lack of let-bindings. For - dictionaries want to achieve sharing to avoid recomoputing the + dictionaries want to achieve sharing to avoid recomputing the dictionary. But coercions are entirely erased, so there's little benefit to sharing. Indeed, even if we had a let-binding, we always inline types and coercions at every use site and drop the diff --git a/compiler/GHC/Core/TyCon.hs b/compiler/GHC/Core/TyCon.hs index 7f7f10333b..c8756d3e48 100644 --- a/compiler/GHC/Core/TyCon.hs +++ b/compiler/GHC/Core/TyCon.hs @@ -695,7 +695,7 @@ Why do we have this invariant? * Similarly, when typechecking default definitions for class methods, in GHC.Tc.TyCl.Class.tcClassDecl2, we only have the (final) Class available; - but the variables bound in that class must be in scope. Eample (#19738): + but the variables bound in that class must be in scope. Example (#19738): type P :: k -> Type data P a = MkP diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs index 86b868566c..49db2cb4ca 100644 --- a/compiler/GHC/Core/Type.hs +++ b/compiler/GHC/Core/Type.hs @@ -3012,7 +3012,7 @@ The body of the forall in foo's type has kind (K r), and normally it would make no sense to have forall r. (ty :: K r) because the kind of the forall would escape the binding -of 'r'. But in this case it's fine because (K r) exapands +of 'r'. But in this case it's fine because (K r) expands to Type, so we explicitly /permit/ the type forall r. T r @@ -3714,7 +3714,7 @@ Must Answer is: * Given the first n arguments of T, do the kinds of the non-omitted arguments fill in the omitted arguments? -(This is still a bit hand-wavey, but we'll refine this question incrementally +(This is still a bit hand-wavy, but we'll refine this question incrementally as we explain more of the machinery underlying this process.) Answering this question is precisely the role that the `injectiveVarsOfType` @@ -3787,7 +3787,7 @@ each form of tycon binder: There are some situations where using visible kind application is appropriate and others where it is not (e.g., TH - reification), so the `injective_vars_of_binder` function is parametrized by + reification), so the `injective_vars_of_binder` function is parameterized by a Bool which decides if specified binders should be counted towards injective positions or not. diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs index 8dd6bb6f67..0cf19d81f8 100644 --- a/compiler/GHC/Core/Unfold.hs +++ b/compiler/GHC/Core/Unfold.hs @@ -735,7 +735,7 @@ discount of 10, that'll make each alternative RHS cost zero. We charge 10 for each case alternative (see size_up_alt). If we give a bigger discount (say 20) in conSize, we'll make the case expression cost *nothing*, and that can make a huge case tree cost nothing. This -leads to massive, sometimes exponenial inlinings (#18282). In short, +leads to massive, sometimes exponential inlinings (#18282). In short, don't give a discount that give a negative size to a sub-expression! Historical note 2: Much longer ago, Simon M tried a MUCH bigger diff --git a/compiler/GHC/Core/Unfold/Make.hs b/compiler/GHC/Core/Unfold/Make.hs index 134c8bce69..ae20cb8a26 100644 --- a/compiler/GHC/Core/Unfold/Make.hs +++ b/compiler/GHC/Core/Unfold/Make.hs @@ -207,7 +207,7 @@ specUnfolding to specialise its unfolding. Some important points: Moreover, keeping the INLINABLE thing isn't much help, because the specialised function (probably) isn't overloaded any more. - Conclusion: drop the INLINEALE pragma. In practice what this means is: + Conclusion: drop the INLINEABLE pragma. In practice what this means is: if a stable unfolding has UnfoldingGuidance of UnfWhen, we keep it (so the specialised thing too will always inline) if a stable unfolding has UnfoldingGuidance of UnfIfGoodArgs @@ -419,12 +419,12 @@ Note [Thoughtful forcing in mkCoreUnfolding] Core expressions retained in unfoldings is one of biggest uses of memory when compiling a program. Therefore we have to be careful about retaining copies of old or redundant -templates (see !6202 for a particularlly bad case). +templates (see !6202 for a particularly bad case). With that in mind we want to maintain the invariant that each unfolding only references a single CoreExpr. One place where we have to be careful is in mkCoreUnfolding. -* The template of the unfolding is the result of performing occurence analysis +* The template of the unfolding is the result of performing occurrence analysis (Note [Occurrence analysis of unfoldings]) * Predicates are applied to the unanalysed expression @@ -445,7 +445,7 @@ Therefore we basically had two options in order to fix this: 1. Perform the predicates on the analysed expression. 2. Force the predicates to remove retainer to the old expression if we force the template. -Option 1 is bad because occurence analysis is expensive and destroys any sharing of the unfolding +Option 1 is bad because occurrence analysis is expensive and destroys any sharing of the unfolding with the actual program. (Testing this approach showed peak 25G memory usage) Therefore we got for Option 2 which performs a little more work but compensates by diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs index 4c040b5fb4..d971f1ab1b 100644 --- a/compiler/GHC/Core/Utils.hs +++ b/compiler/GHC/Core/Utils.hs @@ -803,7 +803,7 @@ with a specific constructor is desirable. which causes the KnownBranch optimisation to kick in. If we don't refine DEFAULT to `Foo ip1`, we are left with both case expressions. -2. combineIdenticalAlts does a better job. For exapple (Simon Jacobi) +2. combineIdenticalAlts does a better job. For example (Simon Jacobi) data D = C0 | C1 | C2 case e of @@ -2007,7 +2007,7 @@ dataConInstPat :: [FastString] -- A long enough list of FSs to use for -- -- ex_tvs are intended to be used as binders for existential type args -- --- arg_ids are indended to be used as binders for value arguments, +-- arg_ids are intended to be used as binders for value arguments, -- and their types have been instantiated with inst_tys and ex_tys -- The arg_ids include both evidence and -- programmer-specified arguments (both after rep-ing) diff --git a/compiler/GHC/Data/Graph/Color.hs b/compiler/GHC/Data/Graph/Color.hs index 452da2dbe9..496f98b205 100644 --- a/compiler/GHC/Data/Graph/Color.hs +++ b/compiler/GHC/Data/Graph/Color.hs @@ -95,7 +95,7 @@ colorGraph iterative spinCount colors triv spill graph0 -- try and color the problem nodes -- problem nodes are the ones that were left uncolored because they weren't triv. - -- theres a change we can color them here anyway. + -- there's a change we can color them here anyway. (graph_prob, ksNoColor) = assignColors colors graph_triv ksProblems diff --git a/compiler/GHC/Data/Graph/Ops.hs b/compiler/GHC/Data/Graph/Ops.hs index c34595eb76..d2671f252d 100644 --- a/compiler/GHC/Data/Graph/Ops.hs +++ b/compiler/GHC/Data/Graph/Ops.hs @@ -253,7 +253,7 @@ addExclusions u getClass colors graph -- | Add a coalescence edge to the graph, creating nodes if required. --- It is considered adventageous to assign the same color to nodes in a coalesence. +-- It is considered advantageous to assign the same color to nodes in a coalescence. addCoalesce :: Uniquable k => (k, cls) -> (k, cls) @@ -491,7 +491,7 @@ freezeNode k = if elementOfUniqSet k (nodeCoalesce node) then node { nodeCoalesce = delOneFromUniqSet (nodeCoalesce node) k } else node -- panic "GHC.Data.Graph.Ops.freezeNode: edge to freeze wasn't in the coalesce set" - -- If the edge isn't actually in the coelesce set then just ignore it. + -- If the edge isn't actually in the coalesce set then just ignore it. fm2 = nonDetStrictFoldUniqSet (adjustUFM_C (freezeEdge k)) fm1 -- It's OK to use a non-deterministic fold here because the @@ -609,7 +609,7 @@ validateGraph doc isColored graph $ nonDetEltsUFM $ graphMap graph , not $ null badNodes = pprPanic "GHC.Data.Graph.Ops.validateGraph" - ( text "Supposably colored graph has uncolored nodes." + ( text "Supposedly colored graph has uncolored nodes." $$ text " uncolored nodes: " <> hcat (map (ppr . nodeId) badNodes) $$ doc ) diff --git a/compiler/GHC/Data/Graph/UnVar.hs b/compiler/GHC/Data/Graph/UnVar.hs index f5a9e1e54a..91239ab1d5 100644 --- a/compiler/GHC/Data/Graph/UnVar.hs +++ b/compiler/GHC/Data/Graph/UnVar.hs @@ -43,7 +43,7 @@ import qualified Data.IntSet as S -- at hand, and we do not have that when we turn the domain of a VarEnv into a UnVarSet. -- Therefore, use a IntSet directly (which is likely also a bit more efficient). --- Set of uniques, i.e. for adjancet nodes +-- Set of uniques, i.e. for adjacent nodes newtype UnVarSet = UnVarSet (S.IntSet) deriving Eq diff --git a/compiler/GHC/Data/Stream.hs b/compiler/GHC/Data/Stream.hs index 10f12c4462..32d5ff7e62 100644 --- a/compiler/GHC/Data/Stream.hs +++ b/compiler/GHC/Data/Stream.hs @@ -126,7 +126,7 @@ mapM f str = Stream $ \g h -> runStreamInternal str (g <=< f) h -- | Note this is not very efficient because it traverses the whole stream -- before rebuilding it, avoid using it if you can. mapAccumL used to -- implemented but it wasn't used anywhere in the compiler and has similar --- effiency problems. +-- efficiency problems. mapAccumL_ :: forall m a b c r . Monad m => (c -> a -> m (c,b)) -> c -> Stream m a r -> Stream m b (c, r) mapAccumL_ f c str = Stream $ \f h -> go c f h (runStream str) diff --git a/compiler/GHC/Driver/Env/KnotVars.hs b/compiler/GHC/Driver/Env/KnotVars.hs index e6d6c8a4d7..df744d4582 100644 --- a/compiler/GHC/Driver/Env/KnotVars.hs +++ b/compiler/GHC/Driver/Env/KnotVars.hs @@ -57,7 +57,7 @@ Initially 'KnotVars' was just a 'ModuleEnv a' but there is one tricky use of the data structure in 'mkDsEnvs' which required this generalised structure. In interactive mode the TypeEnvs from all the previous statements are merged -togethed into one big TypeEnv. 'dsLookupVar' relies on `tcIfaceVar'. The normal +together into one big TypeEnv. 'dsLookupVar' relies on `tcIfaceVar'. The normal lookup functions either look in the HPT or EPS but there is no entry for the `Ghci<N>` modules in either, so the whole merged TypeEnv for all previous Ghci* is stored in the `if_rec_types` variable and then lookup checks there in the case of any interactive module. @@ -71,7 +71,7 @@ Note [KnotVars: Why store the domain?] Normally there's a 'Module' at hand to tell us which 'TypeEnv' we want to interrogate at a particular time, apart from one case, when constructing the in-scope set -when linting an unfolding. In this case the whole environemnt is needed to tell us +when linting an unfolding. In this case the whole environment is needed to tell us everything that's in-scope at top-level in the loop because whilst we are linting unfoldings the top-level identifiers from modules in the cycle might not be globalised properly yet. @@ -89,7 +89,7 @@ There is a simple invariant which should hold for the KnotVars constructor: This invariant is difficult to test but easy to check using ghc-debug. The usage of NoKnotVars is intended to make this invariant easier to check. -The most common situation where a KnotVars is retained accidently is if a HscEnv +The most common situation where a KnotVars is retained accidentally is if a HscEnv which contains reference to a KnotVars is used during interface file loading. The thunks created during this process will retain a reference to the KnotVars. In theory, all these references should be removed by 'maybeRehydrateAfter' as that rehydrates all diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs index fd23d2e81e..9f3c14524f 100644 --- a/compiler/GHC/Driver/Flags.hs +++ b/compiler/GHC/Driver/Flags.hs @@ -362,7 +362,7 @@ data GeneralFlag | Opt_VersionMacros | Opt_WholeArchiveHsLibs -- copy all libs into a single folder prior to linking binaries - -- this should elivate the excessive command line limit restrictions + -- this should alleviate the excessive command line limit restrictions -- on windows, by only requiring a single -L argument instead of -- one for each dependency. At the time of this writing, gcc -- forwards all -L flags to the collect2 command without using a diff --git a/compiler/GHC/Driver/GenerateCgIPEStub.hs b/compiler/GHC/Driver/GenerateCgIPEStub.hs index 6f5de8af4a..647457d44c 100644 --- a/compiler/GHC/Driver/GenerateCgIPEStub.hs +++ b/compiler/GHC/Driver/GenerateCgIPEStub.hs @@ -43,7 +43,7 @@ Stacktraces can be created from return frames as they are pushed to stack for ev But to make them readable / meaningful, one needs to know the source location of each return frame. Every return frame has a distinct info table and thus a distinct code pointer (for tables next to -code) or at least a distict address itself. Info Table Provernance Entries (IPE) are searchable by +code) or at least a distinct address itself. Info Table Provenance Entries (IPEs) are searchable by this pointer and contain a source location. The info table / info table code pointer to source location map is described in: diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index 546fbda015..aa7fd59889 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -1639,7 +1639,7 @@ hscSimplify' plugins ds_result = do -- Interface generators -------------------------------------------------------------- --- | Generate a striped down interface file, e.g. for boot files or when ghci +-- | Generate a stripped down interface file, e.g. for boot files or when ghci -- generates interface files. See Note [simpleTidyPgm - mkBootModDetailsTc] hscSimpleIface :: HscEnv -> TcGblEnv diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs index d1f9ba0104..cb0efac6ad 100644 --- a/compiler/GHC/Driver/Make.hs +++ b/compiler/GHC/Driver/Make.hs @@ -861,9 +861,9 @@ a pair of an `IO a` action and a `MVar a`, where to place the result. blocking. * runPipelines takes this list and eventually passes it to runLoop which executes each action and places the result into the right MVar. -* The amount of parrelism is controlled by a semaphore. This is just used around the +* The amount of parallelism is controlled by a semaphore. This is just used around the module compilation step, so that only the right number of modules are compiled at - the same time which reduces overal memory usage and allocations. + the same time which reduces overall memory usage and allocations. * Each proper node has a LogQueue, which dictates where to send it's output. * The LogQueue is placed into the LogQueueQueue when the action starts and a worker thread processes the LogQueueQueue printing logs for each module in a stable order. @@ -992,7 +992,7 @@ mkBuildResult = BuildResult data BuildLoopState = BuildLoopState { buildDep :: M.Map NodeKey BuildResult -- The current way to build a specific TNodeKey, without cycles this just points to - -- the appropiate result of compiling a module but with + -- the appropriate result of compiling a module but with -- cycles there can be additional indirection and can point to the result of typechecking a loop , nNODE :: Int , hug_var :: MVar HomeUnitGraph @@ -2414,7 +2414,7 @@ executeCompileNode k n !old_hmi hug mrehydrate_mods mod = do -- Localise the hsc_env to use the cached flags hscSetFlags lcl_dynflags $ hydrated_hsc_env - -- Compile the module, locking with a semphore to avoid too many modules + -- Compile the module, locking with a semaphore to avoid too many modules -- being compiled at the same time leading to high memory usage. wrapAction lcl_hsc_env $ do res <- upsweep_mod lcl_hsc_env env_messager old_hmi mod k n @@ -2634,7 +2634,7 @@ X.hs module X where ``` If in `--make` we compile R.hs-boot, then A.hs, then X.hs, we'll get a `ModDetails` for `X` that has an AbstractTyCon for `T` in the the argument type of `MkX`. So: -* Either we should delay compiling X until after R has beeen compiled. (This is what we do) +* Either we should delay compiling X until after R has been compiled. (This is what we do) * Or we should rehydrate X after compiling R -- because it transitively depends on R.hs-boot. Ticket #20200 has exposed some issues to do with the knot-tying logic in GHC.Make, in `--make` mode. @@ -2846,7 +2846,7 @@ runAllPipelines n_jobs env acts = do MC.bracket spawn_actions kill_actions $ \_ -> do mapM_ waitMakeAction acts --- | Execute each action in order, limiting the amount of parrelism by the given +-- | Execute each action in order, limiting the amount of parallelism by the given -- semaphore. runLoop :: (((forall a. IO a -> IO a) -> IO ()) -> IO a) -> MakeEnv -> [MakeAction] -> IO [a] runLoop _ _env [] = return [] diff --git a/compiler/GHC/Driver/MakeFile.hs b/compiler/GHC/Driver/MakeFile.hs index 35a429a7d4..a770637311 100644 --- a/compiler/GHC/Driver/MakeFile.hs +++ b/compiler/GHC/Driver/MakeFile.hs @@ -261,7 +261,7 @@ processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC (ModuleNode _ node)) -- Emit a dependency for each CPP import ; when (depIncludeCppDeps dflags) $ do - -- CPP deps are descovered in the module parsing phase by parsing + -- CPP deps are discovered in the module parsing phase by parsing -- comment lines left by the preprocessor. -- Note that GHC.parseModule may throw an exception if the module -- fails to parse, which may not be desirable (see #16616). diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index 0ebe1f792f..1ab60387f1 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -897,7 +897,7 @@ The idea in the future is that we can now implement different instiations of `TPipelineClass` to give different behaviours that the default `HookedPhase` implementation: * Additional logging of different phases -* Automatic parrelism (in the style of shake) +* Automatic parallelism (in the style of shake) * Easy consumption by external tools such as ghcide * Easier to create your own pipeline and extend existing pipelines. diff --git a/compiler/GHC/Driver/Pipeline/Execute.hs b/compiler/GHC/Driver/Pipeline/Execute.hs index 72a9e49278..b3737dc7e8 100644 --- a/compiler/GHC/Driver/Pipeline/Execute.hs +++ b/compiler/GHC/Driver/Pipeline/Execute.hs @@ -584,7 +584,7 @@ runUnlitPhase hsc_env input_fn output_fn = do -- Unicode or anything else (so we don't use Util.charToC -- here). If we get this wrong, then in -- GHC.HsToCore.Ticks.isGoodTickSrcSpan where we check that the filename in - -- a SrcLoc is the same as the source filenaame, the two will + -- a SrcLoc is the same as the source filename, the two will -- look bogusly different. See test: -- libraries/hpc/tests/function/subdir/tough2.hs escape ('\\':cs) = '\\':'\\': escape cs @@ -838,7 +838,7 @@ getOutputFilename logger tmpfs stop_phase output basename dflags next_phase mayb | StopLn <- next_phase, Just loc <- maybe_location = return $ if dynamicNow dflags then ml_dyn_obj_file loc else ml_obj_file loc - -- 2. If output style is persistant then + -- 2. If output style is persistent then | is_last_phase, Persistent <- output = persistent_fn -- 3. Specific file is only set when outputFile is set by -o -- If we are in dynamic mode but -dyno is not set then write to the same path as @@ -1138,7 +1138,7 @@ none of this can be used in that case. Note [Object merging] ~~~~~~~~~~~~~~~~~~~~~ On most platforms one can "merge" a set of relocatable object files into a new, -partiall-linked-but-still-relocatable object. In a typical UNIX-style linker, +partially-linked-but-still-relocatable object. In a typical UNIX-style linker, this is accomplished with the `ld -r` command. We rely on this for two ends: * We rely on `ld -r` to squash together split sections, making GHCi loading @@ -1369,7 +1369,7 @@ Introduction At some point during compilation with -fhpc, in the function `GHC.HsToCore.Ticks.isGoodTickSrcSpan`, we compare the filename that a `SrcSpan` refers to with the name of the file we are currently compiling. - For some reason I don't yet understand, they can sometimes legitimally be + For some reason I don't yet understand, they can sometimes legitimately be different, and then hpc ignores that SrcSpan. Problem diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 9d03c434f6..db25fc7bc7 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -415,7 +415,7 @@ flattenIncludes specs = Build systems with a remote cache like Bazel or Buck (or Shake, see #16956) store the build artifacts produced by a build BA for reuse in subsequent builds. - Embedding source paths in interface fingerprints will thwart these attemps and + Embedding source paths in interface fingerprints will thwart these attempts and lead to unnecessary recompilations when the source paths in BA differ from the source paths in subsequent builds. -} @@ -742,7 +742,7 @@ data DynFlags = DynFlags { 'doFloatFromRhs'; with this we can control floating out with GHC flags. This addresses https://gitlab.haskell.org/ghc/ghc/-/issues/13663 and - allows for experminentation. + allows for experimentation. -} class HasDynFlags m where @@ -773,7 +773,7 @@ class ContainsDynFlags t where extractDynFlags :: t -> DynFlags ----------------------------------------------------------------------------- --- Accessessors from 'DynFlags' +-- Accessors from 'DynFlags' -- | "unbuild" a 'Settings' from a 'DynFlags'. This shouldn't be needed in the -- vast majority of code. But GHCi questionably uses this to produce a default @@ -2382,7 +2382,7 @@ dynamic_flags_deps = [ , make_ord_flag defFlag "fdiagnostics-color=never" (NoArg (upd (\d -> d { useColor = Never }))) - -- Suppress all that is suppressable in core dumps. + -- Suppress all that is suppressible in core dumps. -- Except for uniques, as some simplifier phases introduce new variables that -- have otherwise identical names. , make_ord_flag defGhcFlag "dsuppress-all" diff --git a/compiler/GHC/Hs/Binds.hs b/compiler/GHC/Hs/Binds.hs index 1e759208c1..0bb16cc0a7 100644 --- a/compiler/GHC/Hs/Binds.hs +++ b/compiler/GHC/Hs/Binds.hs @@ -67,7 +67,7 @@ import Data.Data (Data) Global bindings (where clauses) -} --- the ...LR datatypes are parametrized by two id types, +-- the ...LR datatypes are parameterized by two id types, -- one for the left and one for the right. type instance XHsValBinds (GhcPass pL) (GhcPass pR) = EpAnn AnnList diff --git a/compiler/GHC/Hs/DocString.hs b/compiler/GHC/Hs/DocString.hs index 7e35004237..8297d3a2de 100644 --- a/compiler/GHC/Hs/DocString.hs +++ b/compiler/GHC/Hs/DocString.hs @@ -124,7 +124,7 @@ instance Binary HsDocStringDecorator where type LHsDocStringChunk = Located HsDocStringChunk --- | A continguous chunk of documentation +-- | A contiguous chunk of documentation newtype HsDocStringChunk = HsDocStringChunk ByteString deriving (Eq,Ord,Data, Show) @@ -192,6 +192,6 @@ unlines' :: [String] -> String unlines' = intercalate "\n" -- | Just get the docstring, without any decorators --- Seperates docstrings using "\n\n", which is how haddock likes to render them +-- Separates docstrings using "\n\n", which is how haddock likes to render them renderHsDocStrings :: [HsDocString] -> String renderHsDocStrings = intercalate "\n\n" . map renderHsDocString diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs index 5b2ee9dc73..5c40d351ec 100644 --- a/compiler/GHC/Hs/Expr.hs +++ b/compiler/GHC/Hs/Expr.hs @@ -1765,7 +1765,7 @@ pprTypedSplice :: (OutputableBndrId p) => Maybe SplicePointName -> LHsExpr (GhcP pprTypedSplice n e = ppr_splice (text "$$") n e pprUntypedSplice :: forall p. (OutputableBndrId p) - => Bool -- Whether to preceed the splice with "$" + => Bool -- Whether to precede the splice with "$" -> Maybe SplicePointName -- Used for pretty printing when exists -> HsUntypedSplice (GhcPass p) -> SDoc diff --git a/compiler/GHC/HsToCore/Binds.hs b/compiler/GHC/HsToCore/Binds.hs index 930a9ca220..053c9959a2 100644 --- a/compiler/GHC/HsToCore/Binds.hs +++ b/compiler/GHC/HsToCore/Binds.hs @@ -526,7 +526,7 @@ happen as a result of method sharing), there's a danger that we never get to do the inlining, which is a Terribly Bad thing given that the user said "inline"! -To avoid this we pre-emptively eta-expand the definition, so that foo +To avoid this we preemptively eta-expand the definition, so that foo has the arity with which it is declared in the source code. In this example it has arity 2 (one for the Eq and one for x). Doing this should mean that (foo d) is a PAP and we don't share it. diff --git a/compiler/GHC/HsToCore/Expr.hs b/compiler/GHC/HsToCore/Expr.hs index 702ded54a3..36e289e695 100644 --- a/compiler/GHC/HsToCore/Expr.hs +++ b/compiler/GHC/HsToCore/Expr.hs @@ -325,7 +325,7 @@ which we desugar to `negate (fromIntegral 1)`. Notice it's crucial we still desugar to the correct (negate (fromIntegral ...)) despite performing the negation in order to check whether the application of negate will overflow. -For a user written Integer instance we can't predict the interation of negate and fromIntegral. +For a user written Integer instance we can't predict the interaction of negate and fromIntegral. Also note that this works for detecting the right result for `-128 :: Int8`.. which is in-range for Int8 but the correct result is achieved via two overflows. @@ -592,7 +592,7 @@ beneficial. This is a bit of a trade-off, At the moment we use a simple heuristic to determine whether build will be fruitful: for small lists we assume the benefits of fusion will be worthwhile; -for long lists we assume that the benefits will be outweighted by the cost of +for long lists we assume that the benefits will be outweighed by the cost of code duplication. This magic length threshold is @maxBuildLength@. Also, fusion won't work at all if rewrite rules are disabled, so we don't use the build-based desugaring in this case. diff --git a/compiler/GHC/HsToCore/Match.hs b/compiler/GHC/HsToCore/Match.hs index 4e3df9b3ae..fd3a9ee015 100644 --- a/compiler/GHC/HsToCore/Match.hs +++ b/compiler/GHC/HsToCore/Match.hs @@ -753,7 +753,7 @@ matchWrapper it creates another equation if the match can fail (see @GHC.HsToCore.Expr.doDo@ function) \item @let@ patterns, are treated by @matchSimply@ - List Comprension Patterns, are treated by @matchSimply@ also + List Comprehension Patterns, are treated by @matchSimply@ also \end{itemize} We can't call @matchSimply@ with Lambda patterns, diff --git a/compiler/GHC/HsToCore/Match/Literal.hs b/compiler/GHC/HsToCore/Match/Literal.hs index 2913404b00..61e0f750d0 100644 --- a/compiler/GHC/HsToCore/Match/Literal.hs +++ b/compiler/GHC/HsToCore/Match/Literal.hs @@ -118,7 +118,7 @@ Note [FractionalLit representation] There is a fun wrinkle to this, we used to simply compute the value for these literals and store it as `Rational`. While this might seem reasonable it meant typechecking literals of extremely large numbers -wasn't possible. This happend for example in #15646. +wasn't possible. This happened for example in #15646. There a user would write in GHCi e.g. `:t 1e1234111111111111111111111` which would trip up the compiler. The reason being we would parse it as diff --git a/compiler/GHC/HsToCore/Monad.hs b/compiler/GHC/HsToCore/Monad.hs index 9211b52fd7..9bd53fa341 100644 --- a/compiler/GHC/HsToCore/Monad.hs +++ b/compiler/GHC/HsToCore/Monad.hs @@ -167,11 +167,11 @@ data MatchResult a | MR_Fallible (CoreExpr -> DsM a) deriving (Functor) --- | Product is an "or" on falliblity---the combined match result is infallible +-- | Product is an "or" on fallibility---the combined match result is infallible -- only if the left and right argument match results both were. -- -- This is useful for combining a bunch of alternatives together and then --- getting the overall falliblity of the entire group. See 'mkDataConCase' for +-- getting the overall fallibility of the entire group. See 'mkDataConCase' for -- an example. instance Applicative MatchResult where pure v = MR_Infallible (pure v) diff --git a/compiler/GHC/HsToCore/Pmc.hs b/compiler/GHC/HsToCore/Pmc.hs index c810834c64..61ddb6458a 100644 --- a/compiler/GHC/HsToCore/Pmc.hs +++ b/compiler/GHC/HsToCore/Pmc.hs @@ -318,7 +318,7 @@ We detect an inaccessible RHS simply by pretending it's redundant, until we see -- * Formatting and reporting warnings -- --- | A datatype to accomodate the different call sites of +-- | A datatype to accommodate the different call sites of -- 'formatReportWarnings'. Used for extracting 'CIRB's from a concrete 'ann' -- through 'collectInMode'. Since this is only possible for a couple of -- well-known 'ann's, this is a GADT. diff --git a/compiler/GHC/HsToCore/Pmc/Desugar.hs b/compiler/GHC/HsToCore/Pmc/Desugar.hs index c0d0d9f0e9..8dac5e38d6 100644 --- a/compiler/GHC/HsToCore/Pmc/Desugar.hs +++ b/compiler/GHC/HsToCore/Pmc/Desugar.hs @@ -487,7 +487,7 @@ abstraction we match against) might be different than that of @pat@. Data instances such as @Sing (a :: Bool)@ are a good example of this: If we would just drop the coercion, we'd get a type error when matching @pat@ against its value abstraction, with the result being that pmIsSatisfiable decides that every -possible data constructor fitting @pat@ is rejected as uninhabitated, leading to +possible data constructor fitting @pat@ is rejected as uninhabited, leading to a lot of false warnings. But we can check whether the coercion is a hole or if it is just refl, in diff --git a/compiler/GHC/HsToCore/Pmc/Ppr.hs b/compiler/GHC/HsToCore/Pmc/Ppr.hs index e8221d961f..9d57e99b07 100644 --- a/compiler/GHC/HsToCore/Pmc/Ppr.hs +++ b/compiler/GHC/HsToCore/Pmc/Ppr.hs @@ -2,7 +2,7 @@ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} --- | Provides factilities for pretty-printing 'Nabla's in a way appropriate for +-- | Provides facilities for pretty-printing 'Nabla's in a way appropriate for -- user facing pattern match warnings. module GHC.HsToCore.Pmc.Ppr ( pprUncovered diff --git a/compiler/GHC/HsToCore/Pmc/Solver.hs b/compiler/GHC/HsToCore/Pmc/Solver.hs index b78433283b..d038f397a5 100644 --- a/compiler/GHC/HsToCore/Pmc/Solver.hs +++ b/compiler/GHC/HsToCore/Pmc/Solver.hs @@ -409,7 +409,7 @@ pmIsClosedType ty -- (See "Type#type_classification" for what an algebraic type is.) -- -- This is qualified with \"like\" because of a particular special - -- case: TYPE (the underlyind kind behind Type, among others). TYPE + -- case: TYPE (the underlying kind behind Type, among others). TYPE -- is conceptually a datatype (and thus algebraic), but in practice it is -- a primitive builtin type, so we must check for it specially. -- @@ -1067,7 +1067,7 @@ 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. -* @x ~ I# y@, @x ≁ [4,2]@. 'eqPmAltCon' returns @PossiblyOverlap@, so orthogal. +* @x ~ I# y@, @x ≁ [4,2]@. 'eqPmAltCon' returns @PossiblyOverlap@, so orthogonal. We keep this info in order to be able to refute a redundant match on i.e. 4 later on. @@ -1344,7 +1344,7 @@ varNeedsTesting old_ty_st MkNabla{nabla_ty_st=new_ty_st} vi = do -- Internally uses and updates the CompleteMatchs in vi_rcm. -- -- NB: Does /not/ filter each CompleteMatch with the oracle; members may --- remain that do not statisfy it. This lazy approach just +-- remain that do not satisfy it. This lazy approach just -- avoids doing unnecessary work. instantiate :: Int -> Nabla -> VarInfo -> MaybeT DsM VarInfo instantiate fuel nabla vi = {-# SCC "instantiate" #-} @@ -1481,7 +1481,7 @@ triviallyInhabitedTyConKeys = mkUniqSet [ compareConLikeTestability :: ConLike -> ConLike -> Ordering -- We should instantiate DataCons first, because they are likely to occur in -- multiple COMPLETE sets at once and we might find that multiple COMPLETE sets --- are inhabitated by instantiating only a single DataCon. +-- are inhabited by instantiating only a single DataCon. compareConLikeTestability PatSynCon{} _ = GT compareConLikeTestability _ PatSynCon{} = GT compareConLikeTestability (RealDataCon a) (RealDataCon b) = mconcat @@ -1620,7 +1620,7 @@ A complete algorithm would mean that definition be flagged as inexhaustive (no false positives). Via the LYG algorithm, we reduce both these properties to a property on -the inhabitation test of refinementment types: +the inhabitation test of refinement types: *Soundness*: If the inhabitation test says "no" for a given refinement type Nabla, then it provably has no inhabitant. *Completeness*: If the inhabitation test says "yes" for a given refinement type @@ -1736,7 +1736,7 @@ If we try to instantiate each of its fields, that will require us to once again check if `MkT` is inhabitable in each of those three fields, which in turn will require us to check if `MkT` is inhabitable again... As you can see, the branching factor adds up quickly, and if the initial fuel is, say, -100, then the inhabiation test will effectively take forever. +100, then the inhabitation test will effectively take forever. To mitigate this, we check the branching factor every time we are about to do inhabitation testing in 'instCon'. If the branching factor exceeds 1 diff --git a/compiler/GHC/HsToCore/Utils.hs b/compiler/GHC/HsToCore/Utils.hs index 7eb60afd78..c21b6af0b3 100644 --- a/compiler/GHC/HsToCore/Utils.hs +++ b/compiler/GHC/HsToCore/Utils.hs @@ -422,7 +422,7 @@ f x True = False Adding 'f x False = error "Non-exhaustive pattern..."' would violate the linearity of x. -Instead, we use 'f x False = case error "Non-exhausive pattern..." :: () of {}'. +Instead, we use 'f x False = case error "Non-exhaustive pattern..." :: () of {}'. This case expression accounts for linear variables by assigning bottom usage (See Note [Bottom as a usage] in GHC.Core.Multiplicity). This is done in mkErrorAppDs, called from mkFailExpr. @@ -1066,7 +1066,7 @@ isTrueLHsExpr :: LHsExpr GhcTc -> Maybe (CoreExpr -> DsM CoreExpr) -- Returns Just {..} if we're sure that the expression is True -- I.e. * 'True' datacon -- * 'otherwise' Id --- * Trivial wappings of these +-- * Trivial wrappings of these -- The arguments to Just are any HsTicks that we have found, -- because we still want to tick then, even it they are always evaluated. isTrueLHsExpr (L _ (HsVar _ (L _ v))) diff --git a/compiler/GHC/Iface/Ext/Types.hs b/compiler/GHC/Iface/Ext/Types.hs index 44619808af..674741bfd0 100644 --- a/compiler/GHC/Iface/Ext/Types.hs +++ b/compiler/GHC/Iface/Ext/Types.hs @@ -621,7 +621,7 @@ instance Outputable RecFieldContext where ppr RecFieldDecl = text "declaration" ppr RecFieldAssign = text "assignment" ppr RecFieldMatch = text "pattern match" - ppr RecFieldOcc = text "occurence" + ppr RecFieldOcc = text "occurrence" instance Binary RecFieldContext where put_ bh b = putByte bh (fromIntegral (fromEnum b)) diff --git a/compiler/GHC/Iface/Recomp.hs b/compiler/GHC/Iface/Recomp.hs index 860833077f..64fff6cdc1 100644 --- a/compiler/GHC/Iface/Recomp.hs +++ b/compiler/GHC/Iface/Recomp.hs @@ -926,7 +926,7 @@ we use is: group_fingerprint. Since we included the sequence number in step (1) programs identical up to - transposition of recursive occurrences are distinguisable, avoiding the + transposition of recursive occurrences are distinguishable, avoiding the second issue mentioned above. 3. Produce the final environment by extending hash_env, mapping each diff --git a/compiler/GHC/Iface/Recomp/Binary.hs b/compiler/GHC/Iface/Recomp/Binary.hs index 8fd9ef858f..60f0d5fc86 100644 --- a/compiler/GHC/Iface/Recomp/Binary.hs +++ b/compiler/GHC/Iface/Recomp/Binary.hs @@ -1,6 +1,6 @@ --- | Computing fingerprints of values serializeable with GHC's \"Binary\" module. +-- | Computing fingerprints of values serializable with GHC's \"Binary\" module. module GHC.Iface.Recomp.Binary ( -- * Computing fingerprints fingerprintBinMem diff --git a/compiler/GHC/Iface/Tidy.hs b/compiler/GHC/Iface/Tidy.hs index 373a881c0c..515402abc5 100644 --- a/compiler/GHC/Iface/Tidy.hs +++ b/compiler/GHC/Iface/Tidy.hs @@ -1267,7 +1267,7 @@ tidyTopIdInfo rhs_tidy_env name rhs_ty orig_rhs tidy_rhs idinfo show_unfold | Just (_, bot_str_sig, _) <- mb_bot_str = bot_str_sig - -- No stricness info + -- No strictness info | otherwise = nopSig cpr = cprSigInfo idinfo diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs index acef3bca68..bdf1547f23 100644 --- a/compiler/GHC/IfaceToCore.hs +++ b/compiler/GHC/IfaceToCore.hs @@ -605,7 +605,7 @@ mkSelfBootInfo iface mds return $ SelfBoot { sb_mds = mds , sb_tcs = mkNameSet tcs } where - -- Retuerns @True@ if, when you call 'tcIfaceDecl' on + -- Returns @True@ if, when you call 'tcIfaceDecl' on -- this 'IfaceDecl', an ATyCon would be returned. -- NB: This code assumes that a TyCon cannot be implicit. isIfaceTyCon IfaceId{} = False diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs index 286c50416c..b6645db655 100644 --- a/compiler/GHC/Linker/Loader.hs +++ b/compiler/GHC/Linker/Loader.hs @@ -1753,7 +1753,7 @@ gccSearchDirCache = unsafePerformIO $ newIORef [] -- fork/exec is expensive on Windows, for each time we ask GCC for a library we -- have to eat the cost of af least 3 of these: gcc -> real_gcc -> cc1. -- So instead get a list of location that GCC would search and use findDirs --- which hopefully is written in an optimized mannor to take advantage of +-- which hopefully is written in an optimized manner to take advantage of -- caching. At the very least we remove the overhead of the fork/exec and waits -- which dominate a large percentage of startup time on Windows. getGccSearchDirectory :: Logger -> DynFlags -> String -> IO [FilePath] diff --git a/compiler/GHC/Linker/MacOS.hs b/compiler/GHC/Linker/MacOS.hs index 576b9e7feb..8b46ffd96c 100644 --- a/compiler/GHC/Linker/MacOS.hs +++ b/compiler/GHC/Linker/MacOS.hs @@ -36,7 +36,7 @@ import Text.ParserCombinators.ReadP as Parser -- macOS Sierra (10.14). -- -- @-dead_strip_dylibs@ does not dead strip @-rpath@ entries, as such passing --- @-l@ and @-rpath@ to the linker will result in the unnecesasry libraries not +-- @-l@ and @-rpath@ to the linker will result in the unnecessary libraries not -- being included in the load commands, however the @-rpath@ entries are all -- forced to be included. This can lead to 100s of @-rpath@ entries being -- included when only a handful of libraries end up being truly linked. diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y index 904f566458..360c464327 100644 --- a/compiler/GHC/Parser.y +++ b/compiler/GHC/Parser.y @@ -462,7 +462,7 @@ Example: foo :: (:%) Ambiguity: - If we reduced, (:%) would be parsed as a parenthehsized infix type + If we reduced, (:%) would be parsed as a parenthesized infix type expression without arguments, resulting in the 'failOpFewArgs' error. We shift, so it is parsed as a type constructor. diff --git a/compiler/GHC/Parser/Annotation.hs b/compiler/GHC/Parser/Annotation.hs index 2f00422f8b..101c14f4ef 100644 --- a/compiler/GHC/Parser/Annotation.hs +++ b/compiler/GHC/Parser/Annotation.hs @@ -547,7 +547,7 @@ realSpanAsAnchor s = Anchor s UnchangedAnchor -- element, and print them together with the element, interleaving -- them into the output stream. But when editing the AST to move -- fragments around it is useful to be able to first separate the --- comments into those occuring before the AST element and those +-- comments into those occurring before the AST element and those -- following it. The 'EpaCommentsBalanced' constructor is used to do -- this. The GHC parser will only insert the 'EpaComments' form. data EpAnnComments = EpaComments @@ -633,7 +633,7 @@ meaning we can have type LocatedN RdrName -- Annotations for items in a list -- --------------------------------------------------------------------- --- | Captures the location of punctuation occuring between items, +-- | Captures the location of punctuation occurring between items, -- normally in a list. It is captured as a trailing annotation. data TrailingAnn = AddSemiAnn EpaLocation -- ^ Trailing ';' diff --git a/compiler/GHC/Parser/Errors/Types.hs b/compiler/GHC/Parser/Errors/Types.hs index f0314d80c7..aac26d5532 100644 --- a/compiler/GHC/Parser/Errors/Types.hs +++ b/compiler/GHC/Parser/Errors/Types.hs @@ -77,7 +77,7 @@ data PsMessage {-| PsWarnBidirectionalFormatChars is a warning (controlled by the -Wwarn-bidirectional-format-characters flag) that occurs when unicode bi-directional format characters are found within in a file - The 'PsLoc' contains the exact position in the buffer the character occured, and the + The 'PsLoc' contains the exact position in the buffer the character occurred, and the string contains a description of the character. -} | PsWarnBidirectionalFormatChars (NonEmpty (PsLoc, Char, String)) @@ -498,7 +498,7 @@ data ParseContext = ParseContext { is_infix :: !(Maybe RdrName) -- ^ If 'Just', this is an infix - -- pattern with the binded operator name + -- pattern with the bound operator name , incomplete_do_block :: !PatIncompleteDoBlock -- ^ Did the parser likely fail due to an incomplete do block? } deriving Eq diff --git a/compiler/GHC/Parser/Lexer.x b/compiler/GHC/Parser/Lexer.x index 71e5fa5eb8..12928d8c0e 100644 --- a/compiler/GHC/Parser/Lexer.x +++ b/compiler/GHC/Parser/Lexer.x @@ -2431,7 +2431,7 @@ data PState = PState { -- implement pushCurrentContext (which is only called from one place). -- AZ question: setLastToken which sets last_loc and last_len - -- is called whan processing AlexToken, immediately prior to + -- is called when processing AlexToken, immediately prior to -- calling the action in the token. So from the perspective -- of the action, it is the *current* token. Do I understand -- correctly? diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index 9cce37e051..d89ef3ee8d 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -2985,7 +2985,7 @@ instance MonadP PV where {- Note [Parser-Validator Details] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A PV computation is parametrized by some 'ParseContext' for diagnostic messages, which can be set +A PV computation is parameterized by some 'ParseContext' for diagnostic messages, which can be set depending on validation context. We use this in checkPattern to fix #984. Consider this example, where the user has forgotten a 'do': diff --git a/compiler/GHC/Parser/PostProcess/Haddock.hs b/compiler/GHC/Parser/PostProcess/Haddock.hs index 95f02f8f21..00fa69b770 100644 --- a/compiler/GHC/Parser/PostProcess/Haddock.hs +++ b/compiler/GHC/Parser/PostProcess/Haddock.hs @@ -1576,7 +1576,7 @@ constructs that are separated by a keyword. For example: We could use EPA (exactprint annotations) to fix this, but not without modification. For example, EpaLocation contains RealSrcSpan but not BufSpan. -Also, the fix would be more straghtforward after #19623. +Also, the fix would be more straightforward after #19623. For examples, see tests/haddock/should_compile_flag_haddock/T17544_kw.hs -} diff --git a/compiler/GHC/Plugins.hs b/compiler/GHC/Plugins.hs index 6456c9231c..12ec3fead2 100644 --- a/compiler/GHC/Plugins.hs +++ b/compiler/GHC/Plugins.hs @@ -197,7 +197,7 @@ thNameToGhcName th_name = do -- For now, the easiest and recommended way to ensure a consistent -- 'NameCache' is used it to retrieve the preexisting one from an active -- 'HscEnv'. A single 'HscEnv' is created per GHC "session", and this --- ensures everything in that sesssion will getthe same name cache. +-- ensures everything in that session will get the same name cache. thNameToGhcNameIO :: NameCache -> TH.Name -> IO (Maybe Name) thNameToGhcNameIO cache th_name = do { names <- mapMaybeM lookup (thRdrNameGuesses th_name) diff --git a/compiler/GHC/Prelude.hs b/compiler/GHC/Prelude.hs index 0f8740f62d..81d860f618 100644 --- a/compiler/GHC/Prelude.hs +++ b/compiler/GHC/Prelude.hs @@ -76,7 +76,7 @@ other depending on the DEBUG setting. Why do we then continue on to re-export the rest of Data.Bits? If we would not what is likely to happen is: * Someone imports Data.Bits, uses xor. Things are fine. -* They add a shift and get an ambigious definition error. +* They add a shift and get an ambiguous definition error. * The are puzzled for a bit. * They either: + Remove the import of Data.Bits and get an error because xor is not in scope. diff --git a/compiler/GHC/Rename/Bind.hs b/compiler/GHC/Rename/Bind.hs index a70a3df06c..21789ef89a 100644 --- a/compiler/GHC/Rename/Bind.hs +++ b/compiler/GHC/Rename/Bind.hs @@ -767,7 +767,7 @@ rnPatSynBind sig_fn bind@(PSB { psb_id = L l name Note [Renaming pattern synonym variables] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We rename pattern synonym declaractions backwards to normal to reuse +We rename pattern synonym declarations backwards to normal to reuse the logic already implemented for renaming patterns. We first rename the RHS of a declaration which brings into diff --git a/compiler/GHC/Rename/Env.hs b/compiler/GHC/Rename/Env.hs index 29184bf7f5..3d3ded48f0 100644 --- a/compiler/GHC/Rename/Env.hs +++ b/compiler/GHC/Rename/Env.hs @@ -762,7 +762,7 @@ data DisambigInfo -- monoid will combine them to this failing case. instance Outputable DisambigInfo where - ppr NoOccurrence = text "NoOccurence" + ppr NoOccurrence = text "NoOccurrence" ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres @@ -866,7 +866,7 @@ 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, 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 -the encloseing instance decl, if any. +the enclosing instance decl, if any. Note [Looking up Exact RdrNames] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs index eacaf6468a..9e7decb2ff 100644 --- a/compiler/GHC/Rename/Expr.hs +++ b/compiler/GHC/Rename/Expr.hs @@ -1382,7 +1382,7 @@ Note that (c) The 'bs' in the second group must obviously not be captured by the binding in the first group -To satisfy (a) we nest the segements. +To satisfy (a) we nest the segments. To satisfy (b) we check for duplicates just before thing_inside. To satisfy (c) we reset the LocalRdrEnv each time. @@ -1809,7 +1809,7 @@ transformation loses the ability to do A and C in parallel. The algorithm works by first splitting the sequence of statements into independent "segments", and a separate "tail" (the final statement). In -our example above, the segements would be +our example above, the segments would be [ x <- A , y <- B x ] @@ -2727,7 +2727,7 @@ mkExpandedExpr a b = XExpr (HsExpanded a b) -- -- See Note [Overview of record dot syntax] in GHC.Hs.Expr. --- mkGetField arg field calcuates a get_field @field arg expression. +-- mkGetField arg field calculates a get_field @field arg expression. -- e.g. z.x = mkGetField z x = get_field @x z mkGetField :: Name -> LHsExpr GhcRn -> LocatedAn NoEpAnns FieldLabelString -> HsExpr GhcRn mkGetField get_field arg field = unLoc (head $ mkGet get_field [arg] field) diff --git a/compiler/GHC/Rename/Fixity.hs b/compiler/GHC/Rename/Fixity.hs index 39462baf36..5c8fe36fcb 100644 --- a/compiler/GHC/Rename/Fixity.hs +++ b/compiler/GHC/Rename/Fixity.hs @@ -127,7 +127,7 @@ lookupFixityRn_help' :: Name lookupFixityRn_help' name occ | isUnboundName name = return (False, Fixity NoSourceText minPrecedence InfixL) - -- Minimise errors from ubound names; eg + -- Minimise errors from unbound names; eg -- a>0 `foo` b>0 -- where 'foo' is not in scope, should not give an error (#7937) diff --git a/compiler/GHC/Rename/HsType.hs b/compiler/GHC/Rename/HsType.hs index 04c0c73adb..8c4e6c6ad7 100644 --- a/compiler/GHC/Rename/HsType.hs +++ b/compiler/GHC/Rename/HsType.hs @@ -1342,7 +1342,7 @@ mkHsOpTyRn prom1 op1 fix1 ty1 (L loc2 (HsOpTy _ prom2 ty2a op2 ty2b)) = do { fix2 <- lookupTyFixityRn op2 ; mk_hs_op_ty prom1 op1 fix1 ty1 prom2 op2 fix2 ty2a ty2b loc2 } -mkHsOpTyRn prom1 op1 _ ty1 ty2 -- Default case, no rearrangment +mkHsOpTyRn prom1 op1 _ ty1 ty2 -- Default case, no rearrangement = return (HsOpTy noAnn prom1 ty1 op1 ty2) --------------- @@ -1410,7 +1410,7 @@ mkOpAppRn ReassociateNegation e1 op1 fix1 e2@(L _ (NegApp {})) -- NegApp can occ --------------------------- -- Default case -mkOpAppRn _ e1 op fix e2 -- Default case, no rearrangment +mkOpAppRn _ e1 op fix e2 -- Default case, no rearrangement = assertPpr (right_op_ok fix (unLoc e2)) (ppr e1 $$ text "---" $$ ppr op $$ text "---" $$ ppr fix $$ text "---" $$ ppr e2) $ return (OpApp fix e1 op e2) @@ -1422,7 +1422,7 @@ data NegationHandling = ReassociateNegation | KeepNegationIntact -- | Name of an operator in an operator application or section data OpName = NormalOp Name -- ^ A normal identifier | NegateOp -- ^ Prefix negation - | UnboundOp OccName -- ^ An unbound indentifier + | UnboundOp OccName -- ^ An unbound identifier | RecFldOp (FieldOcc GhcRn) -- ^ A record field occurrence instance Outputable OpName where @@ -1486,7 +1486,7 @@ mkOpFormRn e1@(L loc (nofix_error, associate_right) = compareFixity fix1 fix2 -- Default case -mkOpFormRn arg1 op fix arg2 -- Default case, no rearrangment +mkOpFormRn arg1 op fix arg2 -- Default case, no rearrangement = return (HsCmdArrForm noExtField op Infix (Just fix) [arg1, arg2]) @@ -1524,7 +1524,7 @@ mkConOpPatRn op2 fix2 p1@(L loc (ConPat NoExtField op1 (InfixCon p1a p1b))) p2 } } -mkConOpPatRn op _ p1 p2 -- Default case, no rearrangment +mkConOpPatRn op _ p1 p2 -- Default case, no rearrangement = assert (not_op_pat (unLoc p2)) $ return $ ConPat { pat_con_ext = noExtField diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs index f387474244..6e196d2b60 100644 --- a/compiler/GHC/Rename/Module.hs +++ b/compiler/GHC/Rename/Module.hs @@ -1299,7 +1299,7 @@ with LHSs with a complicated desugaring (and hence unlikely to match); (e.g. a case expression is not allowed: too elaborate.) But there are legitimate non-trivial args ei, like sections and -lambdas. So it seems simmpler not to check at all, and that is why +lambdas. So it seems simpler not to check at all, and that is why check_e is commented out. -} @@ -1396,7 +1396,7 @@ Note [Dependency analysis of type, class, and instance decls] A TyClGroup represents a strongly connected components of type/class/instance decls, together with the role annotations for the type/class declarations. The renamer uses strongly connected -comoponent analysis to build these groups. We do this for a number of +component analysis to build these groups. We do this for a number of reasons: * Improve kind error messages. Consider @@ -1516,7 +1516,7 @@ rnTyClDecls :: [TyClGroup GhcPs] -> RnM ([TyClGroup GhcRn], FreeVars) -- Rename the declarations and do dependency analysis on them rnTyClDecls tycl_ds - = do { -- Rename the type/class, instance, and role declaraations + = do { -- Rename the type/class, instance, and role declarations ; tycls_w_fvs <- mapM (wrapLocFstMA rnTyClDecl) (tyClGroupTyClDecls tycl_ds) ; let tc_names = mkNameSet (map (tcdName . unLoc . fst) tycls_w_fvs) ; kisigs_w_fvs <- rnStandaloneKindSignatures tc_names (tyClGroupKindSigs tycl_ds) diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs index dce4daa562..8f47d2215e 100644 --- a/compiler/GHC/Rename/Names.hs +++ b/compiler/GHC/Rename/Names.hs @@ -116,7 +116,7 @@ we must also check that these rules hold transitively for all dependent modules and packages. Doing this without caching any trust information would be very slow as we would need to touch all packages and interface files a module depends on. To avoid this we make use of the property that if a modules Safe Haskell -mode changes, this triggers a recompilation from that module in the dependecy +mode changes, this triggers a recompilation from that module in the dependency graph. So we can just worry mostly about direct imports. There is one trust property that can change for a package though without diff --git a/compiler/GHC/Rename/Pat.hs b/compiler/GHC/Rename/Pat.hs index 0d4760defd..7d8b54fa95 100644 --- a/compiler/GHC/Rename/Pat.hs +++ b/compiler/GHC/Rename/Pat.hs @@ -469,7 +469,7 @@ rnBindPat name_maker pat = runCps (rnLPatAndThen name_maker pat) -} -- ----------- Entry point 3: rnLPatAndThen ------------------- --- General version: parametrized by how you make new names +-- General version: parameterized by how you make new names rnLPatsAndThen :: NameMaker -> [LPat GhcPs] -> CpsRn [LPat GhcRn] rnLPatsAndThen mk = mapM (rnLPatAndThen mk) diff --git a/compiler/GHC/Rename/Splice.hs b/compiler/GHC/Rename/Splice.hs index b56b15f625..48a8aa807f 100644 --- a/compiler/GHC/Rename/Splice.hs +++ b/compiler/GHC/Rename/Splice.hs @@ -429,7 +429,7 @@ mkQuasiQuoteExpr flavour quoter (L q_span' quote) unqualSplice :: RdrName -- The RdrName for a SplicePointName. See GHC.Hs.Expr -- Note [Lifecycle of an untyped splice, and PendingRnSplice] --- We use "spn" (which is arbitrary) because it is brief but greppable-for. +-- We use "spn" (which is arbitrary) because it is brief but grepable-for. unqualSplice = mkRdrUnqual (mkVarOccFS (fsLit "spn")) rnUntypedSplice :: HsUntypedSplice GhcPs -> RnM (HsUntypedSplice GhcRn, FreeVars) diff --git a/compiler/GHC/Runtime/Context.hs b/compiler/GHC/Runtime/Context.hs index 88abad2b10..3ddb886a0d 100644 --- a/compiler/GHC/Runtime/Context.hs +++ b/compiler/GHC/Runtime/Context.hs @@ -198,7 +198,7 @@ For example: It would be correct ot re-construct the env from scratch based on -`ic_tythings`, but that'd be quite expensive if there are many entires in +`ic_tythings`, but that'd be quite expensive if there are many entries in `ic_tythings` that shadow each other. Therefore we keep around a that `GlobalRdrEnv` in `igre_prompt_env` that @@ -285,7 +285,7 @@ data InteractiveContext ic_plugins :: !Plugins -- ^ Cache of loaded plugins. We store them here to avoid having to - -- load them everytime we switch to the interctive context. + -- load them every time we switch to the interactive context. } data InteractiveImport diff --git a/compiler/GHC/Runtime/Debugger.hs b/compiler/GHC/Runtime/Debugger.hs index 6e26c5c41d..59fd31dc5b 100644 --- a/compiler/GHC/Runtime/Debugger.hs +++ b/compiler/GHC/Runtime/Debugger.hs @@ -161,7 +161,7 @@ bindSuspensions t = do return t' where --- Processing suspensions. Give names and recopilate info +-- Processing suspensions. Give names and collect info nameSuspensionsAndGetInfos :: HscEnv -> IORef [String] -> TermFold (IO (Term, [(Name,Type,ForeignHValue)])) nameSuspensionsAndGetInfos hsc_env freeNames = TermFold diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs index 2a3099e08b..c702fb5fea 100644 --- a/compiler/GHC/Runtime/Eval.hs +++ b/compiler/GHC/Runtime/Eval.hs @@ -705,7 +705,7 @@ pushResume hsc_env resume = hsc_env { hsc_IC = ictxt1 } There are 3 situations where items are removed from the Id list (or replaced with `Nothing`): 1.) If function `GHC.StgToByteCode.schemeER_wrk` (which creates - the Id list) doesn't find an Id in the ByteCode environement. + the Id list) doesn't find an Id in the ByteCode environment. 2.) If function `GHC.Runtime.Eval.bindLocalsAtBreakpoint` filters out unboxed elements from the Id list, because GHCi cannot yet handle them. @@ -849,7 +849,7 @@ moduleIsInterpreted modl = withSession $ \h -> _not_a_home_module -> return False -- | Looks up an identifier in the current interactive context (for :info) --- Filter the instances by the ones whose tycons (or clases resp) +-- Filter the instances by the ones whose tycons (or classes resp) -- are in scope (qualified or otherwise). Otherwise we list a whole lot too many! -- The exact choice of which ones to show, and which to hide, is a judgement call. -- (see #1581) diff --git a/compiler/GHC/Runtime/Heap/Inspect.hs b/compiler/GHC/Runtime/Heap/Inspect.hs index cf3cc6265f..cd2e20cc19 100644 --- a/compiler/GHC/Runtime/Heap/Inspect.hs +++ b/compiler/GHC/Runtime/Heap/Inspect.hs @@ -781,7 +781,7 @@ cvObtainTerm hsc_env max_depth force old_ty hval = runTR hsc_env $ do EvalSuccess _ -> go (pred max_depth) my_ty old_ty a EvalException ex -> do -- Report the exception to the UI - traceTR $ text "Exception occured:" <+> text (show ex) + traceTR $ text "Exception occurred:" <+> text (show ex) liftIO $ throwIO $ fromSerializableException ex -- Blackholes are indirections iff the payload is not TSO or BLOCKING_QUEUE. If -- the indirection is a TSO or BLOCKING_QUEUE, we return the BLACKHOLE itself as @@ -836,7 +836,7 @@ cvObtainTerm hsc_env max_depth force old_ty hval = runTR hsc_env $ do Nothing -> do -- This can happen for private constructors compiled -O0 -- where the .hi descriptor does not export them -- In such case, we return a best approximation: - -- ignore the unpointed args, and recover the pointeds + -- ignore the unpointed args, and recover the pointed ones -- This preserves laziness, and should be safe. traceTR (text "Not constructor" <+> ppr dcname) let dflags = hsc_dflags hsc_env @@ -1219,7 +1219,7 @@ The checks: ~~~~~~~~~~~ Consider a function obtainType that takes a value and a type and produces the Term representation and a substitution (the improvement). -Assume an auxiliar rtti' function which does the actual job if recovering +Assume an auxiliary rtti' function which does the actual job if recovering the type, but which may produce a false type. In pseudocode: diff --git a/compiler/GHC/Settings.hs b/compiler/GHC/Settings.hs index 4f6e93b0dc..291c77b860 100644 --- a/compiler/GHC/Settings.hs +++ b/compiler/GHC/Settings.hs @@ -167,7 +167,7 @@ dynLibSuffix :: GhcNameVersion -> String dynLibSuffix (GhcNameVersion name ver) = '-':name ++ ver ----------------------------------------------------------------------------- --- Accessessors from 'Settings' +-- Accessors from 'Settings' sProgramName :: Settings -> String sProgramName = ghcNameVersion_programName . sGhcNameVersion diff --git a/compiler/GHC/Stg/Debug.hs b/compiler/GHC/Stg/Debug.hs index 678f95e50e..4dbd5af526 100644 --- a/compiler/GHC/Stg/Debug.hs +++ b/compiler/GHC/Stg/Debug.hs @@ -252,7 +252,7 @@ Note [Distinct Info Tables for Constructors] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In the old times, each usage of a data constructor used the same info table. -This made it impossible to distinguish which actual usuage of a data constructor was +This made it impossible to distinguish which actual usage of a data constructor was contributing primarily to the allocation in a program. Using the `-fdistinct-info-tables` flag you can cause code generation to generate a distinct info table for each usage of a constructor. Then, when inspecting the heap you can see precisely which usage of a constructor diff --git a/compiler/GHC/Stg/InferTags.hs b/compiler/GHC/Stg/InferTags.hs index 9081f21006..9236bc44a6 100644 --- a/compiler/GHC/Stg/InferTags.hs +++ b/compiler/GHC/Stg/InferTags.hs @@ -184,7 +184,7 @@ For functions we never make use of the tag info so we have two choices: careful to make sure we still enter them when needed. As it makes little difference for runtime performance I've treated functions as TagDunno in a few places where it made the code simpler. But besides implementation complexity there isn't any reason -why we couldn't be more rigourous in dealing with functions. +why we couldn't be more rigorous in dealing with functions. NB: It turned in #21193 that PAPs get tag zero, so the tag check can't be omitted for functions. So option two isn't really an option without reworking this anyway. @@ -571,7 +571,7 @@ as argument. As example: let f<?> z = case z of z'<TagProper> -> (# c, x #) Here we will infer for f the Signature <TagTuple[TagProper,TagDunno]>. -This information will be used if we scrutinze a saturated application of +This information will be used if we scrutinize a saturated application of `f` in order to determine the taggedness of the result. That is for `case f x of (# r1,r2 #) -> rhs` we can infer r1<TagProper> and r2<TagDunno> which allows us to skip all tag checks on `r1` diff --git a/compiler/GHC/Stg/InferTags/Rewrite.hs b/compiler/GHC/Stg/InferTags/Rewrite.hs index a9a7677e40..ba2bbf2449 100644 --- a/compiler/GHC/Stg/InferTags/Rewrite.hs +++ b/compiler/GHC/Stg/InferTags/Rewrite.hs @@ -88,12 +88,12 @@ Which will result in a W/W split along the lines of $wf :: (a -> b -> d -> c) -> a -> b -> c -> d $wf m1 a b c = m1 a b c -It's notable that the worker is called *undersatured* in the wrapper. +It's notable that the worker is called *undersaturated* in the wrapper. At runtime what happens is that the wrapper will allocate a PAP which once fully applied will call the worker. And all is fine. But what about a call by value function! Well the function returned by `f` would -be a unknown call, so we lose the ability to enfore the invariant that +be a unknown call, so we lose the ability to enforce the invariant that cbv marked arguments from StictWorkerId's are actually properly tagged as the annotations would be unavailable at the (unknown) call site. @@ -505,7 +505,7 @@ getStrictConArgs con args -- For proper data cons we have to check. | otherwise = assertPpr (length args == length (dataConRuntimeRepStrictness con)) - (text "Missmatched con arg and con rep strictness lengths:" $$ + (text "Mismatched con arg and con rep strictness lengths:" $$ text "Con" <> ppr con <+> text "is applied to" <+> ppr args $$ text "But seems to have arity" <> ppr (length repStrictness)) $ [ arg | (arg,MarkedStrict) diff --git a/compiler/GHC/Stg/Lint.hs b/compiler/GHC/Stg/Lint.hs index f1e7c98321..bb325a2cd3 100644 --- a/compiler/GHC/Stg/Lint.hs +++ b/compiler/GHC/Stg/Lint.hs @@ -134,7 +134,7 @@ lintStgTopBindings :: forall a . (OutputablePass a, BinderP a ~ Id) -> [GenStgTopBinding a] -> IO () -lintStgTopBindings platform logger diag_opts opts extra_vars this_mod unarised whodunnit binds +lintStgTopBindings platform logger diag_opts opts extra_vars this_mod unarised whodunit binds = {-# SCC "StgLint" #-} case initL platform diag_opts this_mod unarised opts top_level_binds (lint_binds binds) of Nothing -> @@ -143,7 +143,7 @@ lintStgTopBindings platform logger diag_opts opts extra_vars this_mod unarised w logMsg logger Err.MCDump noSrcSpan $ withPprStyle defaultDumpStyle (vcat [ text "*** Stg Lint ErrMsgs: in" <+> - text whodunnit <+> text "***", + text whodunit <+> text "***", msg, text "*** Offending Program ***", pprGenStgTopBindings opts binds, diff --git a/compiler/GHC/Stg/Pipeline.hs b/compiler/GHC/Stg/Pipeline.hs index ca7b1aefa2..eb37d73c8c 100644 --- a/compiler/GHC/Stg/Pipeline.hs +++ b/compiler/GHC/Stg/Pipeline.hs @@ -96,7 +96,7 @@ stg2stg logger extra_vars opts this_mod binds diag_opts ppr_opts extra_vars this_mod unarised | otherwise - = \ _whodunnit _binds -> return () + = \ _whodunit _binds -> return () ------------------------------------------- do_stg_pass :: Module -> [StgTopBinding] -> StgToDo -> StgM [StgTopBinding] diff --git a/compiler/GHC/StgToByteCode.hs b/compiler/GHC/StgToByteCode.hs index c94da8792d..6af15363bd 100644 --- a/compiler/GHC/StgToByteCode.hs +++ b/compiler/GHC/StgToByteCode.hs @@ -1346,7 +1346,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) result_ty args_r_to_l copies the args to the C stack, calls the stacked addr, and parks the result back in the placeholder. The interpreter calls it as a normal C call, assuming it has a signature - void marshall_code ( StgWord* ptr_to_top_of_stack ) + void marshal_code ( StgWord* ptr_to_top_of_stack ) -} -- resolve static address maybe_static_target :: Maybe Literal diff --git a/compiler/GHC/StgToCmm/Env.hs b/compiler/GHC/StgToCmm/Env.hs index 4d1fff30df..aced870367 100644 --- a/compiler/GHC/StgToCmm/Env.hs +++ b/compiler/GHC/StgToCmm/Env.hs @@ -119,7 +119,7 @@ addBindsC new_bindings = do setBinds new_binds -- Inside GHC the average module creates 385 external references --- with noteable cgIdInfo (so not generated by mkLFArgument). +-- with notable cgIdInfo (so not generated by mkLFArgument). -- On average 200 of these are covered by True/False/[] -- and nullary constructors make up ~80. -- One would think it would be worthwhile to cache these. diff --git a/compiler/GHC/StgToCmm/Expr.hs b/compiler/GHC/StgToCmm/Expr.hs index 030655c8e2..799b9056f1 100644 --- a/compiler/GHC/StgToCmm/Expr.hs +++ b/compiler/GHC/StgToCmm/Expr.hs @@ -393,7 +393,7 @@ Hence: Two basic plans for * If f is recursive, and the hot loop wouldn't allocate, but the exit branch does then we do a redundant heap check. - * We use one more instruction to de-allocate the unused heap in the branch using less heap. (Neglible) + * We use one more instruction to de-allocate the unused heap in the branch using less heap. (Negligible) * A small risk of running gc slightly more often than needed especially if one branch allocates a lot. The upsides are: diff --git a/compiler/GHC/StgToCmm/Lit.hs b/compiler/GHC/StgToCmm/Lit.hs index 11de674618..318c091a58 100644 --- a/compiler/GHC/StgToCmm/Lit.hs +++ b/compiler/GHC/StgToCmm/Lit.hs @@ -52,7 +52,7 @@ cgLit (LitString s) = -- not unpackFS; we want the UTF-8 byte stream. cgLit (LitRubbish rep) = case expectOnly "cgLit" prim_reps of -- Note [Post-unarisation invariants] - VoidRep -> panic "cgLit:VoidRep" -- dito + VoidRep -> panic "cgLit:VoidRep" -- ditto LiftedRep -> idInfoToAmode <$> getCgIdInfo unitDataConId UnliftedRep -> idInfoToAmode <$> getCgIdInfo unitDataConId AddrRep -> cgLit LitNullAddr diff --git a/compiler/GHC/StgToCmm/Monad.hs b/compiler/GHC/StgToCmm/Monad.hs index 0c3fd1c68e..9f9d292937 100644 --- a/compiler/GHC/StgToCmm/Monad.hs +++ b/compiler/GHC/StgToCmm/Monad.hs @@ -294,7 +294,7 @@ data CgState data FCodeState = MkFCodeState { fcs_upframeoffset :: UpdFrameOffset -- ^ Size of current update frame UpdFrameOffset must be kept lazy or -- else the RTS will deadlock _and_ also experience a severe - -- performance degredation + -- performance degradation , fcs_sequel :: !Sequel -- ^ What to do at end of basic block , fcs_selfloop :: Maybe SelfLoopInfo -- ^ Which tail calls can be compiled as local jumps? -- See Note [Self-recursive tail calls] in GHC.StgToCmm.Expr diff --git a/compiler/GHC/StgToCmm/TagCheck.hs b/compiler/GHC/StgToCmm/TagCheck.hs index afa3fef426..c83b4de5d4 100644 --- a/compiler/GHC/StgToCmm/TagCheck.hs +++ b/compiler/GHC/StgToCmm/TagCheck.hs @@ -73,7 +73,7 @@ whenCheckTags act = do when check_tags act -- | Call barf if we failed to predict a tag correctly. --- This is immensly useful when debugging issues in tag inference +-- This is immensely useful when debugging issues in tag inference -- as it will result in a program abort when we encounter an invalid -- call/heap object, rather than leaving it be and segfaulting arbitrary -- or producing invalid results. @@ -174,6 +174,6 @@ checkArgStatic msg MarkedStrict arg = whenCheckTags $ info <- getCgIdInfo v if taggedCgInfo info then return () - else pprPanic "Arg not tagged as expectd" (ppr msg <+> ppr arg) + else pprPanic "Arg not tagged as expected" (ppr msg <+> ppr arg) diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs index ddda97ab2a..29e9eddbf0 100644 --- a/compiler/GHC/StgToCmm/Utils.hs +++ b/compiler/GHC/StgToCmm/Utils.hs @@ -604,7 +604,7 @@ cmmInfoTableToInfoProvEnt this_mod cmit = in InfoProvEnt cl cn "" this_mod Nothing -- | Convert source information collected about identifiers in 'GHC.STG.Debug' --- to entries suitable for placing into the info table provenenance table. +-- to entries suitable for placing into the info table provenance table. convertInfoProvMap :: [CmmInfoTable] -> Module -> InfoTableProvMap -> [InfoProvEnt] convertInfoProvMap defns this_mod (InfoTableProvMap (UniqMap dcenv) denv infoTableToSourceLocationMap) = map (\cmit -> diff --git a/compiler/GHC/SysTools/Ar.hs b/compiler/GHC/SysTools/Ar.hs index ab4e02cf42..adba60b53c 100644 --- a/compiler/GHC/SysTools/Ar.hs +++ b/compiler/GHC/SysTools/Ar.hs @@ -6,7 +6,7 @@ Building `-staticlib` previously required the presence of libtool, and was a such restricted to mach-o only. As libtool on macOS and gnu libtool are very different, there was no simple portable way to support this. -libtool for static archives does essentially: concatinate the input archives, +libtool for static archives does essentially: concatenate the input archives, add the input objects, and create a symbol index. Using `ar` for this task fails as even `ar` (bsd and gnu, llvm, ...) do not provide the same features across platforms (e.g. index prefixed retrieval of objects with @@ -144,7 +144,7 @@ getGNUArchEntries extInfo = do if C.unpack (C.take 1 name) == "/" then case C.takeWhile (/= ' ') name of name@"/" -> name -- symbol table - name@"//" -> name -- extendedn file names table + name@"//" -> name -- extended file names table name -> getExtName extInfo (read . C.unpack $ C.drop 1 name) else C.takeWhile (/= '/') name case name of @@ -158,7 +158,7 @@ getGNUArchEntries extInfo = do getExtName (Just info) offset = C.takeWhile (/= '/') . C.drop offset $ filedata info -- | put an Archive Entry. This assumes that the entries --- have been preprocessed to account for the extenden file name +-- have been preprocessed to account for the extended file name -- table section "//" e.g. for GNU Archives. Or that the names -- have been move into the payload for BSD Archives. putArchEntry :: ArchiveEntry -> PutM () diff --git a/compiler/GHC/SysTools/BaseDir.hs b/compiler/GHC/SysTools/BaseDir.hs index 9f6908f74e..99aebd9bc8 100644 --- a/compiler/GHC/SysTools/BaseDir.hs +++ b/compiler/GHC/SysTools/BaseDir.hs @@ -122,7 +122,7 @@ play nice with the system compiler instead. -- | Expand occurrences of the @$tooldir@ interpolation in a string -- on Windows, leave the string untouched otherwise. expandToolDir - :: Bool -- ^ whether we are use the ambiant mingw toolchain + :: Bool -- ^ whether we are use the ambient mingw toolchain -> Maybe FilePath -- ^ tooldir -> String -> String #if defined(mingw32_HOST_OS) @@ -166,7 +166,7 @@ tryFindTopDir Nothing -- tooldir can't be located, or returns @Just tooldirpath@. -- If the distro toolchain is being used we treat Windows the same as Linux findToolDir - :: Bool -- ^ whether we are use the ambiant mingw toolchain + :: Bool -- ^ whether we are use the ambient mingw toolchain -> FilePath -- ^ topdir -> IO (Maybe FilePath) #if defined(mingw32_HOST_OS) diff --git a/compiler/GHC/SysTools/Elf.hs b/compiler/GHC/SysTools/Elf.hs index da517e25dd..1dc8f9f43d 100644 --- a/compiler/GHC/SysTools/Elf.hs +++ b/compiler/GHC/SysTools/Elf.hs @@ -70,7 +70,7 @@ import qualified Data.ByteString.Lazy.Char8 as B8 same thing applies to the field containing the number of segments, but we don't care about it here). - ELF-next: to solve this, theses fields in the ELF header have an escape + ELF-next: to solve this, these fields in the ELF header have an escape value (different for each case), and the actual section number is stashed into unused fields in the first section header. diff --git a/compiler/GHC/Tc/Deriv.hs b/compiler/GHC/Tc/Deriv.hs index f12fefcffe..0a873ff05e 100644 --- a/compiler/GHC/Tc/Deriv.hs +++ b/compiler/GHC/Tc/Deriv.hs @@ -1632,7 +1632,7 @@ e.g. newtype S1 = S1 [T1 ()] newtype T1 a = T1 (StateT S1 IO a ) deriving( Monad ) Remember, too, that type families are currently (conservatively) given a recursive flag, so this also allows newtype deriving to work -for type famillies. +for type families. We used to exclude recursive types, because we had a rather simple minded way of generating the instance decl: diff --git a/compiler/GHC/Tc/Deriv/Generate.hs b/compiler/GHC/Tc/Deriv/Generate.hs index 4cacf36013..49d97e81e1 100644 --- a/compiler/GHC/Tc/Deriv/Generate.hs +++ b/compiler/GHC/Tc/Deriv/Generate.hs @@ -452,7 +452,7 @@ gen_Ord_binds loc dit@(DerivInstTys{ dit_rep_tc = tycon = nlHsCase (nlHsVar a_RDR) $ map (mkOrdOpAlt op) tycon_data_cons -- i.e. case a of { C1 x y -> case b of C1 x y -> ....compare x,y... - -- C2 x -> case b of C2 x -> ....comopare x.... } + -- C2 x -> case b of C2 x -> ....compare x.... } | null non_nullary_cons -- All nullary, so go straight to comparing tags = mkTagCmp op diff --git a/compiler/GHC/Tc/Deriv/Generics.hs b/compiler/GHC/Tc/Deriv/Generics.hs index 85a73274ce..2c7639c3a9 100644 --- a/compiler/GHC/Tc/Deriv/Generics.hs +++ b/compiler/GHC/Tc/Deriv/Generics.hs @@ -1056,7 +1056,7 @@ is usually too small for GHC to do that. The recommended approach thus far was to increase unfolding threshold, but this makes GHC inline more aggressively in general, whereas it should only be more -aggresive with generics-based code. +aggressive with generics-based code. The solution is to use a heuristic that'll annotate Generic class methods with INLINE[1] pragmas (the explicit phase is used to give users phase control as diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs index 35deaf06bc..6d0bf4d117 100644 --- a/compiler/GHC/Tc/Errors.hs +++ b/compiler/GHC/Tc/Errors.hs @@ -1484,7 +1484,7 @@ mkIPErr ctxt items ---------------- -- | Report a representation-polymorphism error to the user: --- a type is required to havehave a fixed runtime representation, +-- a type is required to have a fixed runtime representation, -- but doesn't. -- -- See Note [Reporting representation-polymorphism errors] in GHC.Tc.Types.Origin. diff --git a/compiler/GHC/Tc/Errors/Hole.hs b/compiler/GHC/Tc/Errors/Hole.hs index f0a8e7aa8e..1011144afc 100644 --- a/compiler/GHC/Tc/Errors/Hole.hs +++ b/compiler/GHC/Tc/Errors/Hole.hs @@ -400,7 +400,7 @@ is discarded. Note [Speeding up valid hole-fits] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To fix #16875 we noted that a lot of time was being spent on uneccessary work. +To fix #16875 we noted that a lot of time was being spent on unecessary work. When we'd call `tcCheckHoleFit hole hole_ty ty`, we would end up by generating a constraint to show that `hole_ty ~ ty`, including any constraints in `ty`. For diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs index a6125e7dfc..16d91f1c44 100644 --- a/compiler/GHC/Tc/Errors/Types.hs +++ b/compiler/GHC/Tc/Errors/Types.hs @@ -144,7 +144,7 @@ one for the context and one for any supplementary information. Consider the foll Under the hood, the reporting functions in Tc.Utils.Monad were emitting "Couldn't match" as the important part, "In the expression" as the context and "In a stmt..In the expression" as the supplementary, with the context and supplementary usually smashed together so that -the final message would be composed only by two SDoc (which would then be bulletted like in +the final message would be composed only by two SDoc (which would then be bulleted like in the example). In order for us to smooth out the migration to the new diagnostic infrastructure, we @@ -331,7 +331,7 @@ data TcRnMessage where Test cases: plugins/T19926 -} TcRnUnsafeDueToPlugin :: TcRnMessage - {-| TcRnModMissingRealSrcSpan is an error that occurrs when compiling a module that lacks + {-| TcRnModMissingRealSrcSpan is an error that occurs when compiling a module that lacks an associated 'RealSrcSpan'. Test cases: None @@ -2128,7 +2128,7 @@ data TcRnMessage where -> !(NE.NonEmpty (LocatedA InlinePragma)) -- ^ Other pragmas -> TcRnMessage - {- TcRnUnexpectedPragmas is a warning that occurrs when unexpected pragmas appear + {- TcRnUnexpectedPragmas is a warning that occurs when unexpected pragmas appear in the source. Example(s): @@ -2150,7 +2150,7 @@ data TcRnMessage where -} TcRnNonOverloadedSpecialisePragma :: !(LIdP GhcRn) -> TcRnMessage - {- TcRnSpecialiseNotVisible is a warning that occurrs when the subject of a + {- TcRnSpecialiseNotVisible is a warning that occurs when the subject of a SPECIALISE pragma has a definition that is not visible from the current module. Example(s): none @@ -2481,7 +2481,7 @@ data DeriveInstanceErrReason !DeriveAnyClassEnabled -- ^ Whether or not -XDeriveAnyClass is enabled -- already. - -- | Stock deriving won't work, but perhas DeriveAnyClass will. + -- | Stock deriving won't work, but perhaps DeriveAnyClass will. | DerivErrNotDeriveable !DeriveAnyClassEnabled -- | The given 'PredType' is not a class. | DerivErrNotAClass !PredType @@ -2884,7 +2884,7 @@ data TcSolverReportMsg | FixedRuntimeRepError [FixedRuntimeRepErrorInfo] -- | An equality between two types is blocked on a kind equality - -- beteen their kinds. + -- between their kinds. -- -- Test cases: none. | BlockedEquality ErrorItem @@ -3162,7 +3162,7 @@ data NotInScopeError -- Test cases: annfail01, annfail02, annfail11. | NoTopLevelBinding - -- | A class doesnt have a method with this name, + -- | A class doesn't have a method with this name, -- or, a class doesn't have an associated type with this name, -- or, a record doesn't have a record field with this name. | UnknownSubordinate SDoc @@ -3270,7 +3270,7 @@ data RelevantBindings -- | Display some relevant bindings. pprRelevantBindings :: RelevantBindings -> SDoc -- This function should be in "GHC.Tc.Errors.Ppr", --- but's it's here for the moment as it's needed in "GHC.Tc.Errors". +-- but it's here for the moment as it's needed in "GHC.Tc.Errors". pprRelevantBindings (RelevantBindings bds ran_out_of_fuel) = ppUnless (null rel_bds) $ hang (text "Relevant bindings include") diff --git a/compiler/GHC/Tc/Gen/App.hs b/compiler/GHC/Tc/Gen/App.hs index 4f04e82cf2..7d64f0d1ef 100644 --- a/compiler/GHC/Tc/Gen/App.hs +++ b/compiler/GHC/Tc/Gen/App.hs @@ -86,7 +86,7 @@ Some notes relative to the paper * When QL is done, we don't need to turn the un-filled-in instantiation variables into unification variables -- they - already /are/ unification varibles! See also + already /are/ unification variables! See also Note [Instantiation variables are short lived]. * We cleverly avoid the quadratic cost of QL, alluded to in the paper. @@ -216,7 +216,7 @@ Fig 3, plus the modification in Fig 5, of the QL paper: It treats application chains (f e1 @ty e2) specially: -* So we can report errors like "in the third arument of a call of f" +* So we can report errors like "in the third argument of a call of f" * So we can do Visible Type Application (VTA), for which we must not eagerly instantiate the function part of the application. @@ -1060,7 +1060,7 @@ qlUnify delta ty1 ty2 ; writeMetaTyVar kappa (mkCastTy ty2 co) } | otherwise - = return () -- Occurs-check or forall-bound varialbe + = return () -- Occurs-check or forall-bound variable {- Note [Actual unification in qlUnify] @@ -1085,7 +1085,7 @@ That is the entire point of qlUnify! Wrinkles: * What if kappa and ty have different kinds? We solve that problem by calling unifyKind, producing a coercion perhaps emitting some deferred equality constraints. That is /different/ from the approach we use in - the main constraint solver for herterogeneous equalities; see Note + the main constraint solver for heterogeneous equalities; see Note [Equalities with incompatible kinds] in Solver.Canonical Why different? Because: diff --git a/compiler/GHC/Tc/Gen/Bind.hs b/compiler/GHC/Tc/Gen/Bind.hs index d13b3b197c..fedea75796 100644 --- a/compiler/GHC/Tc/Gen/Bind.hs +++ b/compiler/GHC/Tc/Gen/Bind.hs @@ -1153,7 +1153,7 @@ Consider this from #18646 We get [W] Foo (), [W] Applicative f. When we do pickCapturedPreds in choose_psig_context, we'll discard Foo ()! Usually would not quantify over such (closed) predicates. So my_theta will be (Applicative f). But we really -do want to quantify over (Foo ()) -- it was speicfied by the programmer. +do want to quantify over (Foo ()) -- it was specified by the programmer. Solution: always return annotated_theta (user-specified) plus the extra piece diff_theta. @@ -1354,7 +1354,7 @@ with -XImpredicativeTypes we can infer a good type for (combine head ids), and use that to tell us the polymorphic types of x and y. -We don't need to check -XImpredicativeTypes beucase without it +We don't need to check -XImpredicativeTypes because without it these types like [forall a. a->a] are illegal anyway, so this special case code only really has an effect if -XImpredicativeTypes is on. Small exception: diff --git a/compiler/GHC/Tc/Gen/Export.hs b/compiler/GHC/Tc/Gen/Export.hs index efc6433f29..d42ee046b5 100644 --- a/compiler/GHC/Tc/Gen/Export.hs +++ b/compiler/GHC/Tc/Gen/Export.hs @@ -125,7 +125,7 @@ are both type constructors into two GRES. , T defined at A.hs:4:23 ] Then, we get @[C{C;}, C{T;}, T{T;}, T{D;}]@, which eventually gets merged -into @[C{C, T;}, T{T, D;}]@ (which satsifies the AvailTC invariant). +into @[C{C, T;}, T{T, D;}]@ (which satisfies the AvailTC invariant). -} data ExportAccum -- The type of the accumulating parameter of @@ -758,4 +758,4 @@ exportClashErr global_env child1 child2 ie1 ie2 case SrcLoc.leftmost_smallest (greSrcSpan gre1) (greSrcSpan gre2) of LT -> (child1, gre1, ie1, child2, gre2, ie2) GT -> (child2, gre2, ie2, child1, gre1, ie1) - EQ -> panic "exportClashErr: clashing exports have idential location" + EQ -> panic "exportClashErr: clashing exports have identical location" diff --git a/compiler/GHC/Tc/Gen/Expr.hs b/compiler/GHC/Tc/Gen/Expr.hs index 6a4eb7f6f1..c5c5616024 100644 --- a/compiler/GHC/Tc/Gen/Expr.hs +++ b/compiler/GHC/Tc/Gen/Expr.hs @@ -185,7 +185,7 @@ tcPolyExpr expr res_ty tcExpr :: HsExpr GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc) --- Use tcApp to typecheck appplications, which are treated specially +-- Use tcApp to typecheck applications, which are treated specially -- by Quick Look. Specifically: -- - HsVar lone variables, to ensure that they can get an -- impredicative instantiation (via Quick Look @@ -287,7 +287,7 @@ tcExpr e@(HsLamCase x lc_variant matches) res_ty ************************************************************************ -} --- Explict lists [e1,e2,e3] have been expanded already in the renamer +-- Explicit lists [e1,e2,e3] have been expanded already in the renamer -- The expansion includes an ExplicitList, but it is always the built-in -- list type, so that's all we need concern ourselves with here. See -- GHC.Rename.Expr. Note [Handling overloaded and rebindable constructs] @@ -1306,7 +1306,7 @@ desugarRecordUpd record_expr rbnds res_ty ; nm <- newNameAt nm_occ generatedSrcSpan ; let id = mkLocalId nm m actual_arg_ty -- NB: create fresh names to avoid any accidental shadowing - -- occuring in the RHS expressions when creating the let bindings: + -- occurring in the RHS expressions when creating the let bindings: -- -- let x1 = e1; x2 = e2; ... ; return (fld_nm, (id, rhs)) diff --git a/compiler/GHC/Tc/Gen/Foreign.hs b/compiler/GHC/Tc/Gen/Foreign.hs index 0f1c9084d7..57b30c9548 100644 --- a/compiler/GHC/Tc/Gen/Foreign.hs +++ b/compiler/GHC/Tc/Gen/Foreign.hs @@ -96,7 +96,7 @@ declaration. If we have newtype Age = MkAge Int we want to see that Age -> IO () is the same as Int -> IO (). But, we don't -need to recur on any type parameters, because no paramaterized types (with +need to recur on any type parameters, because no parameterized types (with interesting parameters) are marshalable! The full list of marshalable types is in the body of boxedMarshalableTyCon in GHC.Tc.Utils.TcType. The only members of that list not at kind * are Ptr, FunPtr, and StablePtr, all of which get marshaled diff --git a/compiler/GHC/Tc/Gen/Head.hs b/compiler/GHC/Tc/Gen/Head.hs index dd67b7f2b2..6341aecf8d 100644 --- a/compiler/GHC/Tc/Gen/Head.hs +++ b/compiler/GHC/Tc/Gen/Head.hs @@ -956,7 +956,7 @@ tcExprSig _ expr sig@(PartialSig { psig_name = name, sig_loc = loc }) {- Note [Partial expression signatures] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Partial type signatures on expressions are easy to get wrong. But -here is a guiding principile +here is a guiding principle e :: ty should behave like let x :: ty diff --git a/compiler/GHC/Tc/Gen/HsType.hs b/compiler/GHC/Tc/Gen/HsType.hs index 3fed598f4d..c6deae4be2 100644 --- a/compiler/GHC/Tc/Gen/HsType.hs +++ b/compiler/GHC/Tc/Gen/HsType.hs @@ -336,7 +336,7 @@ than the surrounding context.) This kappa cannot be solved for while checking the pattern signature (which is not kind-generalized). When we are checking the *body* of foo, though, we need to unify the type of x with the argument type of bar. At this point, the ambient TcLevel is 1, and spotting a -matavariable with level 2 would violate the (WantedInv) invariant of +metavariable with level 2 would violate the (WantedInv) invariant of Note [TcLevel invariants]. So, instead of kind-generalizing, we promote the metavariable to level 1. This is all done in kindGeneralizeNone. @@ -1320,7 +1320,7 @@ This table summarises this relation: | f :: forall {a}. type HsForAllInvis InferredSpec Inferred | f :: forall a -> type HsForAllVis SpecifiedSpec Required | f :: forall {a} -> type HsForAllVis InferredSpec / -| This last form is non-sensical and is thus rejected. +| This last form is nonsensical and is thus rejected. ---------------------------------------------------------------------------- For more information regarding the interpretation of the resulting ArgFlag, see @@ -2447,7 +2447,7 @@ kcInferDeclHeader kcInferDeclHeader name flav (HsQTvs { hsq_ext = kv_ns , hsq_explicit = hs_tvs }) kc_res_ki - -- No standalane kind signature and no CUSK. + -- No standalone kind signature and no CUSK. -- See Note [Required, Specified, and Inferred for types] in GHC.Tc.TyCl = addTyConFlavCtxt name flav $ do { (scoped_kvs, (tc_tvs, res_kind)) @@ -2616,7 +2616,7 @@ matchUpSigWithDecl -- Argument is excess TyConBinders and tail kind -> TcM ( [TcTyConBinder] -- Skolemised binders, with TcTyVars , a ) --- See Note [Matching a kind sigature with a declaration] +-- See Note [Matching a kind signature with a declaration] -- Invariant: Length of returned TyConBinders + length of excess TyConBinders -- = length of incoming TyConBinders matchUpSigWithDecl sig_tcbs sig_res_kind hs_bndrs thing_inside @@ -3505,7 +3505,7 @@ bindTyClTyVarsAndZonk tycon_name thing_inside zonkAndScopedSort :: [TcTyVar] -> TcM [TcTyVar] zonkAndScopedSort spec_tkvs = do { spec_tkvs <- zonkTcTyVarsToTcTyVars spec_tkvs - -- Zonk the kinds, to we can do the dependency analayis + -- Zonk the kinds, to we can do the dependency analysis -- Do a stable topological sort, following -- Note [Ordering of implicit variables] in GHC.Rename.HsType @@ -3603,7 +3603,7 @@ We must * Find the free variables with level > i, in this case gamma[i] * Skolemise those free variables and quantify over them, giving f :: forall g. beta[i-1] -> g - * Emit the residiual constraint wrapped in an implication for g, + * Emit the residual constraint wrapped in an implication for g, thus forall g. WC All of this happens for types too. Consider @@ -4063,7 +4063,7 @@ we do the following * Just as for ordinary signatures, we must solve local equalities and zonk the type after kind-checking it, to ensure that all the nested - forall binders can "see" their occurrenceds + forall binders can "see" their occurrences Just as for ordinary signatures, this zonk also gets any Refl casts out of the way of instantiation. Example: #18008 had diff --git a/compiler/GHC/Tc/Gen/Sig.hs b/compiler/GHC/Tc/Gen/Sig.hs index 4bb9a8038d..138e61978c 100644 --- a/compiler/GHC/Tc/Gen/Sig.hs +++ b/compiler/GHC/Tc/Gen/Sig.hs @@ -112,7 +112,7 @@ especially on value bindings. Here's an overview. but for /partial/ signatures it starts from the HsSyn, so it has to kind-check it etc: tcHsPartialSigType. It's convenient to do this at the same time as instantiation, because we can - make the wildcards into unification variables right away, raather + make the wildcards into unification variables right away, rather than somehow quantifying over them. And the "TcLevel" of those unification variables is correct because we are in tcMonoBinds. diff --git a/compiler/GHC/Tc/Gen/Splice.hs b/compiler/GHC/Tc/Gen/Splice.hs index 027ae27aff..47d19c127b 100644 --- a/compiler/GHC/Tc/Gen/Splice.hs +++ b/compiler/GHC/Tc/Gen/Splice.hs @@ -449,7 +449,7 @@ RENAMER (rnUntypedBracket): SplicePointName, 'spn' * The SplicePointName connects the `PendingRnSplice` with the particular point - in the syntax tree where that expresion should be spliced in. That point + in the syntax tree where that expression should be spliced in. That point in the tree is identified by `(HsUntypedSpliceNested spn)`. It is used by the desugarer, so that we ultimately generate something like let spn = g x diff --git a/compiler/GHC/Tc/Instance/Family.hs b/compiler/GHC/Tc/Instance/Family.hs index 8b76c9f4cd..4a575d614e 100644 --- a/compiler/GHC/Tc/Instance/Family.hs +++ b/compiler/GHC/Tc/Instance/Family.hs @@ -364,7 +364,7 @@ checkFamInstConsistency directlyImpMods -- We could, but doing so means one of two things: -- -- 1. When looping over the cartesian product we convert - -- a set into a non-deterministicly ordered list. Which + -- a set into a non-deterministically ordered list. Which -- happens to be fine for interface file determinism -- in this case, today, because the order only -- determines the order of deferred checks. But such diff --git a/compiler/GHC/Tc/Instance/FunDeps.hs b/compiler/GHC/Tc/Instance/FunDeps.hs index b11ed10efc..710750a57d 100644 --- a/compiler/GHC/Tc/Instance/FunDeps.hs +++ b/compiler/GHC/Tc/Instance/FunDeps.hs @@ -633,7 +633,7 @@ In checkFunDeps we check that a new ClsInst is consistent with all the ClsInsts in the environment. The bogus aspect is discussed in #10675. Currently it if the two -types are *contradicatory*, using (isNothing . tcUnifyTys). But all +types are *contradictory*, using (isNothing . tcUnifyTys). But all the papers say we should check if the two types are *equal* thus not (substTys subst rtys1 `eqTypes` substTys subst rtys2) For now I'm leaving the bogus form because that's the way it has diff --git a/compiler/GHC/Tc/Instance/Typeable.hs b/compiler/GHC/Tc/Instance/Typeable.hs index 3dc6154c84..3c5343722e 100644 --- a/compiler/GHC/Tc/Instance/Typeable.hs +++ b/compiler/GHC/Tc/Instance/Typeable.hs @@ -106,7 +106,7 @@ There are many wrinkles: * GHC.Prim doesn't have any associated object code, so we need to put the representations for types defined in this module elsewhere. We chose this place to be GHC.Types. GHC.Tc.Instance.Typeable.mkPrimTypeableBinds is responsible for - injecting the bindings for the GHC.Prim representions when compiling + injecting the bindings for the GHC.Prim representations when compiling GHC.Types. * TyCon.tyConRepModOcc is responsible for determining where to find diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index aa4d18b8cc..abc4031df0 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -1275,7 +1275,7 @@ checkBootTyCon is_boot tc1 tc2 -- but ONLY if the type synonym is nullary and has no type family -- applications. This arises from two properties of skolem abstract data: -- - -- For any T (with some number of paramaters), + -- For any T (with some number of parameters), -- -- 1. T is a valid type (it is "curryable"), and -- @@ -2727,7 +2727,7 @@ https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0179-printi :type / TM_Inst - In this mode, we report the type obained by instantiating only the + In this mode, we report the type obtained by instantiating only the /inferred/ quantifiers of e's type, solving constraints, and re-generalising, as discussed in #11376. diff --git a/compiler/GHC/Tc/Solver.hs b/compiler/GHC/Tc/Solver.hs index 3ae3836624..6f783a6182 100644 --- a/compiler/GHC/Tc/Solver.hs +++ b/compiler/GHC/Tc/Solver.hs @@ -438,7 +438,7 @@ Our solution is this: We re-emit the implication rather than reporting the errors right now, -so that the error mesages are improved by other solving and defaulting. +so that the error messages are improved by other solving and defaulting. e.g. we prefer Cannot match 'Type->Type' with 'Type' to Cannot match 'Type->Type' with 'TYPE r0' @@ -1013,7 +1013,7 @@ We could do more than once but we'd have to have /some/ limit: in the the recursive case, we would go on forever in the common case where the constraints /are/ satisfiable (#10592 comment:12!). -For stratightforard situations without type functions the try_harder +For straightforward situations without type functions the try_harder step does nothing. Note [tcNormalise] @@ -1668,13 +1668,13 @@ We will ultimately quantify f over (Eq a, C a, <diff>), where At least for single functions we would like to quantify f over precisely the same theta as <quant-theta>, so that we get to take the short-cut path in GHC.Tc.Gen.Bind.mkExport, and avoid calling -tcSubTypeSigma for impedence matching. Why avoid? Because it falls +tcSubTypeSigma for impedance matching. Why avoid? Because it falls over for ambiguous types (#20921). We can get precisely the same theta by using the same algorithm, findInferredDiff. -All of this goes wrong if we have (a) mutual recursion, (b) mutiple +All of this goes wrong if we have (a) mutual recursion, (b) multiple partial type signatures, (c) with different constraints, and (d) ambiguous types. Something like f :: forall a. Eq a => F a -> _ @@ -1848,7 +1848,7 @@ defaultTyVarsAndSimplify rhs_tclvl mono_tvs candidates -- NB: only pass 'DefaultKindVars' when we know we're dealing with a kind variable. tv - -- this common case (no inferred contraints) should be fast + -- this common case (no inferred constraints) should be fast simplify_cand [] = return [] -- see Note [Unconditionally resimplify constraints when quantifying] simplify_cand candidates diff --git a/compiler/GHC/Tc/Solver/Canonical.hs b/compiler/GHC/Tc/Solver/Canonical.hs index ec8e11b168..86569a8109 100644 --- a/compiler/GHC/Tc/Solver/Canonical.hs +++ b/compiler/GHC/Tc/Solver/Canonical.hs @@ -412,7 +412,7 @@ Examples of how adding superclasses can help: instance L (Maybe a) a When solving the superclasses of the (C (Maybe a) a) instance, we get - [G] C a b, and hance by superclasses, [G] G a, [G] L a b + [G] C a b, and hence by superclasses, [G] G a, [G] L a b [W] G (Maybe a) Use the instance decl to get [W] C a beta @@ -590,7 +590,7 @@ mk_strict_superclasses rec_clss (CtGiven { ctev_evar = evar, ctev_loc = loc }) -- GHC.Tc.TyCl.Instance. Skip for a tiny performance win. -- See Note [Solving superclass constraints] in GHC.Tc.TyCl.Instance - -- for explantation of InstSCOrigin and Note [Replacement vs keeping] in + -- for explanation of InstSCOrigin and Note [Replacement vs keeping] in -- GHC.Tc.Solver.Interact for why we need OtherSCOrigin and depths | otherwise = loc { ctl_origin = new_orig } @@ -1179,7 +1179,7 @@ respect typechecker equality. sameVis puts both forms of invisible type variable binders into the same equivalence class. Note that we do /not/ use sameVis in GHC.Core.Type.eqType, which implements -/definitional/ equality, a slighty more coarse-grained notion of equality +/definitional/ equality, a slightly more coarse-grained notion of equality (see Note [Non-trivial definitional equality] in GHC.Core.TyCo.Rep) that does not consider the ArgFlag of ForAllTys at all. That is, eqType would equate all of forall k. <...>, forall {k}. <...>, and forall k -> <...>. @@ -1972,7 +1972,7 @@ If we see (T s1 t1 ~ T s2 t2), then we can just decompose to (s1 ~ s2, t1 ~ t2) and push those back into the work list. But if s1 = K k1 s2 = K k2 -then we will just decomopose s1~s2, and it might be better to +then we will just decompose s1~s2, and it might be better to do so on the spot. An important special case is where s1=s2, and we get just Refl. @@ -2827,7 +2827,7 @@ Details: (5) The approach here is inefficient because it replaces every (outermost) type family application with a type variable, regardless of whether that particular appplication is implicated in the occurs check. An alternative - would be to replce only type-family applications that meantion the offending LHS. + would be to replce only type-family applications that mention the offending LHS. For instance, we could choose to affect only type family applications that mention the offending LHS: e.g. in a ~ (F b, G a), we need to replace only G a, not F b. Furthermore, diff --git a/compiler/GHC/Tc/Solver/InertSet.hs b/compiler/GHC/Tc/Solver/InertSet.hs index 4de3ca8d1f..c1f173ee14 100644 --- a/compiler/GHC/Tc/Solver/InertSet.hs +++ b/compiler/GHC/Tc/Solver/InertSet.hs @@ -338,7 +338,7 @@ VERY IMPORTANT INVARIANT: in the above sense - Exception 1: local quantified constraints have no such guarantee; - indeed, adding a "solved dictionary" when appling a quantified + indeed, adding a "solved dictionary" when applying a quantified constraint led to the ability to define unsafeCoerce in #17267. @@ -883,7 +883,7 @@ The idea is that (this is Lemma (L0)), and hence this triple never plays a role in application S(f,t). It is always safe to extend S with such a triple. - (NB: we could strengten K1) in this way too, but see K3. + (NB: we could strengthen K1) in this way too, but see K3. - (K2b): if lhs not in s, we have no further opportunity to apply the work item diff --git a/compiler/GHC/Tc/Solver/Interact.hs b/compiler/GHC/Tc/Solver/Interact.hs index ac29f55505..59723cfe70 100644 --- a/compiler/GHC/Tc/Solver/Interact.hs +++ b/compiler/GHC/Tc/Solver/Interact.hs @@ -76,7 +76,7 @@ Note [Basic Simplifier Plan] - inert reactions - spontaneous reactions - top-level interactions - Each stage returns a StopOrContinue and may have sideffected + Each stage returns a StopOrContinue and may have sideeffected the inerts or worklist. The threading of the stages is as follows: @@ -912,7 +912,7 @@ Note that: cannot be solved from instances. * The (EvBindMap, DictMap CtEvidence) is an accumulating purely-functional - state that allows try_solve_from_instance to augmennt the evidence + state that allows try_solve_from_instance to augment the evidence bindings and inert_solved_dicts as it goes. If it succeeds, we commit all these bindings and solved dicts to the @@ -985,7 +985,7 @@ We ingore such fundeps for several reasons: [W] iss ~ is2 : beta Again we can't prove that equality; and worse we'll rewrite iss to - (is2:beta) in deeply nested contraints inside this implication, + (is2:beta) in deeply nested constraints inside this implication, where beta is untouchable (under other equality constraints), leading to other insoluble constraints. @@ -1460,7 +1460,7 @@ But it's not so simple: That first argument is invisible in the source program (aside from visible type application), so we'd much prefer to get the error from - the second. We track visiblity in the uo_visible field of a TypeEqOrigin. + the second. We track visibility in the uo_visible field of a TypeEqOrigin. We use this to prioritise visible errors (see GHC.Tc.Errors.tryReporters, the partition on isVisibleOrigin). @@ -1810,7 +1810,7 @@ as the fundeps. -} doTopFundepImprovement :: Ct -> TcS (StopOrContinue Ct) --- Try to functional-dependency improvement betweeen the constraint +-- Try to functional-dependency improvement between the constraint -- and the top-level instance declarations -- See Note [Fundeps with instances] -- See also Note [Weird fundeps] @@ -2432,7 +2432,7 @@ And less obviously to: instance (c1, c2) => (% c1, c2 %) Example in #14218 -Exammples: T5853, T10432, T5315, T9222, T2627b, T3028b +Examples: T5853, T10432, T5315, T9222, T2627b, T3028b PS: the term "naturally coherent" doesn't really seem helpful. Perhaps "invertible" or something? I left it for now though. @@ -2457,7 +2457,7 @@ will be constructed by GHC at a call site... from the very instances that unify with it here. It is not like an incoherent user-written instance which might have utterly different behaviour. -Consdider f :: Eq a => blah. If we have [W] Eq a, we certainly +Consider f :: Eq a => blah. If we have [W] Eq a, we certainly get it from the Eq a context, without worrying that there are lots of top-level instances that unify with [W] Eq a! We'll use those instances to build evidence to pass to f. That's just the diff --git a/compiler/GHC/Tc/Solver/Monad.hs b/compiler/GHC/Tc/Solver/Monad.hs index 6666758226..7eb1df9649 100644 --- a/compiler/GHC/Tc/Solver/Monad.hs +++ b/compiler/GHC/Tc/Solver/Monad.hs @@ -902,7 +902,7 @@ runTcS tcs ; ev_binds <- TcM.getTcEvBindsMap ev_binds_var ; return (res, ev_binds) } --- | This variant of 'runTcS' will immediatley fail upon encountering an +-- | This variant of 'runTcS' will immediately fail upon encountering an -- insoluble ct. See Note [Speeding up valid hole-fits]. Its one usage -- site does not need the ev_binds, so we do not return them. runTcSEarlyAbort :: TcS a -> TcM a diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs index 3e9fa96e39..00cfe6d02b 100644 --- a/compiler/GHC/Tc/TyCl.hs +++ b/compiler/GHC/Tc/TyCl.hs @@ -388,7 +388,7 @@ Open type families This treatment of type synonyms only applies to Haskell 98-style synonyms. General type functions can be recursive, and hence, appear in `alg_decls'. -The kind of an open type family is solely determinded by its kind signature; +The kind of an open type family is solely determined by its kind signature; hence, only kind signatures participate in the construction of the initial kind environment (as constructed by `inferInitialKind'). In fact, we ignore instances of families altogether in the following. However, we need to include @@ -645,7 +645,7 @@ Unfortunately this requires reworking a bit of the code in Note [Don't process associated types in getInitialKind] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Previously, we processed associated types in the thing_inside in getInitialKind, -but this was wrong -- we want to do ATs sepearately. +but this was wrong -- we want to do ATs separately. The consequence for not doing it this way is #15142: class ListTuple (tuple :: Type) (as :: [(k, Type)]) where @@ -985,7 +985,7 @@ following order: 1. Inferred variables 2. Specified variables; in the left-to-right order in which the user wrote them, modified by scopedSort (see below) - to put them in depdendency order. + to put them in dependency order. 3. Required variables before a top-level :: 4. All variables after a top-level :: @@ -1054,7 +1054,7 @@ Design alternatives ~~~~~~~~~~~~~~~~~~~ * For associated types we considered putting the class variables before the local variables, in a nod to the treatment for class - methods. But it got too compilicated; see #15592, comment:21ff. + methods. But it got too complicated; see #15592, comment:21ff. * We rigidly require the ordering above, even though we could be much more permissive. Relevant musings are at @@ -1820,7 +1820,7 @@ However, during tcTyClDecl of T (above) we will be in a recursive "knot". So we aren't allowed to look at the TyCon T itself; we are only allowed to put it (lazily) in the returned structures. But when kind-checking the RHS of T's decl, we *do* need to know T's kind (so -that we can correctly elaboarate (T k f a). How can we get T's kind +that we can correctly elaborate (T k f a). How can we get T's kind without looking at T? Delicate answer: during tcTyClDecl, we extend *Global* env with T -> ATyCon (the (not yet built) final TyCon for T) @@ -2314,7 +2314,7 @@ In the frontend, the following tweaks have been made in the typechecker: data family F a :: UnliftedType data instance F Int = TInt - The ommission of a kind signature for `F` should not mean a result kind + The omission of a kind signature for `F` should not mean a result kind of `Type` (and thus a kind error) here. * STEP 2: No change to kcTyClDecl. @@ -3085,7 +3085,7 @@ The wildcards are particularly awkward: they may need to be quantified So, we use bindOuterFamEqnTKBndrs (which does not create an implication for the telescope), and generalise over /all/ the variables in the LHS, -without treating the explicitly-quantifed ones specially. Wrinkles: +without treating the explicitly-quantified ones specially. Wrinkles: - When generalising, include the explicit user-specified forall'd variables, so that we get an error from Validity.checkFamPatBinders diff --git a/compiler/GHC/Tc/TyCl/Class.hs b/compiler/GHC/Tc/TyCl/Class.hs index 57f8f19e82..4cb0e9d2c0 100644 --- a/compiler/GHC/Tc/TyCl/Class.hs +++ b/compiler/GHC/Tc/TyCl/Class.hs @@ -99,7 +99,7 @@ generates newtype CDict a = CDict (forall b. a -> b -> b) -Now DictTy in Type is just a form of type synomym: +Now DictTy in Type is just a form of type synonym: DictTy c t = TyConTy CDict `AppTy` t Death to "ExpandingDicts". diff --git a/compiler/GHC/Tc/TyCl/Instance.hs b/compiler/GHC/Tc/TyCl/Instance.hs index 72081727be..86b8626d50 100644 --- a/compiler/GHC/Tc/TyCl/Instance.hs +++ b/compiler/GHC/Tc/TyCl/Instance.hs @@ -1099,7 +1099,7 @@ however, so this Note aims to describe these subtleties: Now the subtleties of Note [Newtype eta and homogeneous axioms] are dealt with by the newtype (via mkNewTyConRhs called in tcDataFamInstDecl) while the axiom connecting F Int ~ R:FIntb is eta-reduced, but the - quantifer 'b' is derived from the original data family F, and so the + quantifier 'b' is derived from the original data family F, and so the kinds will always match. Note [Kind inference for data family instances] @@ -2050,7 +2050,7 @@ The instance signature can be *more* polymorphic than the instantiated class method (in this case: Age -> Age -> Bool), but it cannot be less polymorphic. Moreover, if a signature is given, the implementation code should match the signature, and type variables bound in the -singature should scope over the method body. +signature should scope over the method body. We achieve this by building a TcSigInfo for the method, whether or not there is an instance method signature, and using that to typecheck diff --git a/compiler/GHC/Tc/TyCl/PatSyn.hs b/compiler/GHC/Tc/TyCl/PatSyn.hs index bb142f080a..2e9b3c1809 100644 --- a/compiler/GHC/Tc/TyCl/PatSyn.hs +++ b/compiler/GHC/Tc/TyCl/PatSyn.hs @@ -126,7 +126,7 @@ We stop if there are /any/ unsolved constraints, not just insoluble ones; because pattern synonyms are top-level things, we will never solve them later if we can't solve them now. And if we were to carry on, tc_patsyn_finish does zonkTcTypeToType, which defaults any -unsolved unificatdion variables to Any, which confuses the error +unsolved unification variables to Any, which confuses the error reporting no end (#15685). So we use simplifyTop to completely solve the constraint, report @@ -276,7 +276,7 @@ But neither is 's' itself existentially bound, so the forall (s::k->*) can't go in the inner forall either. (What would the matcher apply the continuation to?) -Solution: do not quantiify over any unification variable whose kind +Solution: do not quantify over any unification variable whose kind mentions the existentials. We can conveniently do that by making the "taus" passed to simplifyInfer look like forall ex_tvs. arg_ty @@ -326,7 +326,7 @@ and that is bad because (a ~# Maybe b) is not a predicate type and is not implicitly instantiated. So in mkProvEvidence we lift (a ~# b) to (a ~ b). Tiresome, and -marginally less efficient, if the builder/martcher are not inlined. +marginally less efficient, if the builder/matcher are not inlined. See also Note [Lift equality constraints when quantifying] in GHC.Tc.Solver diff --git a/compiler/GHC/Tc/TyCl/Utils.hs b/compiler/GHC/Tc/TyCl/Utils.hs index 26a28e7296..e071a7c7a2 100644 --- a/compiler/GHC/Tc/TyCl/Utils.hs +++ b/compiler/GHC/Tc/TyCl/Utils.hs @@ -172,7 +172,7 @@ newtype SynCycleM a = SynCycleM { -- TODO: TyConSet is implemented as IntMap over uniques. -- But we could get away with something based on IntSet --- since we only check membershib, but never extract the +-- since we only check membership, but never extract the -- elements. type SynCycleState = TyConSet diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs index 577fc4407c..5c58a73701 100644 --- a/compiler/GHC/Tc/Types.hs +++ b/compiler/GHC/Tc/Types.hs @@ -184,7 +184,7 @@ import GHC.Linker.Types -- 'ns_module_name' @A@, defines a mapping from @{A.T}@ -- (for some 'OccName' @T@) to some arbitrary other 'Name'. -- --- The most intruiging thing about a 'NameShape', however, is +-- The most intriguing thing about a 'NameShape', however, is -- how it's constructed. A 'NameShape' is *implied* by the -- exported 'AvailInfo's of the implementor of an interface: -- if an implementor of signature @\<H>@ exports @M.T@, you implicitly @@ -401,7 +401,7 @@ data FrontendResult -- signatures (we just generate blank object files for -- hsig files.) -- --- A corrolary of this is that the following invariant holds at any point +-- A corollary of this is that the following invariant holds at any point -- past desugaring, -- -- if I have a Module, this_mod, in hand representing the module @@ -1138,7 +1138,7 @@ data TcTyThing | ATyVar Name TcTyVar -- See Note [Type variables in the type environment] | ATcTyCon TyCon -- Used temporarily, during kind checking, for the - -- tycons and clases in this recursive group + -- tycons and classes in this recursive group -- The TyCon is always a TcTyCon. Its kind -- can be a mono-kind or a poly-kind; in TcTyClsDcls see -- Note [Type checking recursive type and class declarations] diff --git a/compiler/GHC/Tc/Types/Constraint.hs b/compiler/GHC/Tc/Types/Constraint.hs index ed05f8a1de..586a6a68aa 100644 --- a/compiler/GHC/Tc/Types/Constraint.hs +++ b/compiler/GHC/Tc/Types/Constraint.hs @@ -1404,7 +1404,7 @@ The GivenEqs data type describes the Given constraints of an implication constra * LocalGivenEqs: definitely no Given equalities that would affect principal types. But may have equalities that affect only skolems of this implication - (and hence do not affect princial types) + (and hence do not affect principal types) Examples: forall a. F a ~ Int => ... forall a b. F a ~ G b => ... @@ -1557,7 +1557,7 @@ Note [Shadowing in a constraint] We assume NO SHADOWING in a constraint. Specifically * The unification variables are all implicitly quantified at top level, and are all unique - * The skolem variables bound in ic_skols are all freah when the + * The skolem variables bound in ic_skols are all fresh when the implication is created. So we can safely substitute. For example, if we have forall a. a~Int => ...(forall b. ...a...)... @@ -2248,7 +2248,7 @@ equality simplification, and type family reduction. (Why combine these? Because it's actually quite easy to mistake one for another, in sufficiently involved scenarios, like ConstraintKinds.) -The flag -freduction-depth=n fixes the maximium level. +The flag -freduction-depth=n fixes the maximum level. * The counter includes the depth of type class instance declarations. Example: [W] d{7} : Eq [Int] diff --git a/compiler/GHC/Tc/Types/Evidence.hs b/compiler/GHC/Tc/Types/Evidence.hs index 42704013a7..82e7847b02 100644 --- a/compiler/GHC/Tc/Types/Evidence.hs +++ b/compiler/GHC/Tc/Types/Evidence.hs @@ -448,7 +448,7 @@ instance Data.Data TcEvBinds where Class constraints etc give rise to /term/ bindings for evidence, and we have nowhere to put term bindings in /types/. So in some places we use CoEvBindsVar (see newCoTcEvBinds) to signal that no term-level -evidence bindings are allowed. Notebly (): +evidence bindings are allowed. Notably (): - Places in types where we are solving kind constraints (all of which are equalities); see solveEqualities diff --git a/compiler/GHC/Tc/Types/Origin.hs b/compiler/GHC/Tc/Types/Origin.hs index 94801fb0df..7d257f4763 100644 --- a/compiler/GHC/Tc/Types/Origin.hs +++ b/compiler/GHC/Tc/Types/Origin.hs @@ -267,7 +267,7 @@ data SkolemInfoAnon | RuleSkol RuleName -- The LHS of a RULE | InferSkol [(Name,TcType)] - -- We have inferred a type for these (mutually-recursivive) + -- We have inferred a type for these (mutually recursive) -- polymorphic Ids, and are now checking that their RHS -- constraints are satisfied. @@ -1056,7 +1056,7 @@ data FixedRuntimeRepContext -- Test cases: RepPolyDoBody{1,2}, RepPolyMcBody. | FRRBodyStmt !StmtOrigin !Int - -- | Arguments to a guard in a monad comprehesion must have + -- | Arguments to a guard in a monad comprehension must have -- a fixed runtime representation. -- -- Test case: RepPolyMcGuard. diff --git a/compiler/GHC/Tc/Utils/Instantiate.hs b/compiler/GHC/Tc/Utils/Instantiate.hs index 4497fe4d4b..1d47b9610e 100644 --- a/compiler/GHC/Tc/Utils/Instantiate.hs +++ b/compiler/GHC/Tc/Utils/Instantiate.hs @@ -247,7 +247,7 @@ instTyVarsWith :: CtOrigin -> [TyVar] -> [TcType] -> TcM Subst -- types [ta, tb, tc], but when the kinds of 'a' and 'ta' might -- not yet match (perhaps because there are unsolved constraints; #14154) -- If they don't match, emit a kind-equality to promise that they will --- eventually do so, and thus make a kind-homongeneous substitution. +-- eventually do so, and thus make a kind-homogeneous substitution. instTyVarsWith orig tvs tys = go emptySubst tvs tys where @@ -669,7 +669,7 @@ Then we have to instantiate the kind variables, build a substitution from old variables to the new variables, then instantiate the type variables substituting the original kind. -Exemple: If we want to instantiate +Example: If we want to instantiate [(k1 :: *), (k2 :: *), (a :: k1 -> k2), (b :: k1)] we want [(?k1 :: *), (?k2 :: *), (?a :: ?k1 -> ?k2), (?b :: ?k1)] diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs index 571e02c7cf..346b1f4273 100644 --- a/compiler/GHC/Tc/Utils/Monad.hs +++ b/compiler/GHC/Tc/Utils/Monad.hs @@ -1191,7 +1191,7 @@ is applied to four arguments. See #18379 for a concrete example. This reliance on delicate inlining and Called Arity is not good. See #18202 for a more general approach. But meanwhile, these -ininings seem unobjectional, and they solve the immediate +inlinings seem unobjectional, and they solve the immediate problem. Note [Error contexts in generated code] @@ -1970,7 +1970,7 @@ We must not discard the out-of-scope error. It's distressingly delicate though: * If we discard too /many/ constraints we may fail to report the error - that led us to interrupte the constraint gathering process. + that led us to interrupt the constraint gathering process. One particular example "variable out of scope" Hole constraints. For example (#12529): diff --git a/compiler/GHC/Tc/Utils/TcMType.hs b/compiler/GHC/Tc/Utils/TcMType.hs index 19f368ba99..1cb4820745 100644 --- a/compiler/GHC/Tc/Utils/TcMType.hs +++ b/compiler/GHC/Tc/Utils/TcMType.hs @@ -614,7 +614,7 @@ ensureMonoType :: TcType -> TcM () -- Assuming that the argument type is of kind (TYPE r), -- ensure that it is a /monotype/ -- If it is not a monotype we can see right away (since unification --- varibles and type-function applications stand for monotypes), but +-- variables and type-function applications stand for monotypes), but -- we emit a Wanted equality just to delay the error message until later ensureMonoType res_ty | isTauTy res_ty -- isTauTy doesn't need zonking or anything @@ -1969,7 +1969,7 @@ What do do? D. We could error. We choose (D), as described in #17567, and implement this choice in -doNotQuantifyTyVars. Dicsussion of alternativs A-C is below. +doNotQuantifyTyVars. Discussion of alternativs A-C is below. NB: this is all rather similar to, but sadly not the same as Note [Naughty quantification candidates] diff --git a/compiler/GHC/Tc/Utils/TcType.hs b/compiler/GHC/Tc/Utils/TcType.hs index 240cfb9ef1..6592912d05 100644 --- a/compiler/GHC/Tc/Utils/TcType.hs +++ b/compiler/GHC/Tc/Utils/TcType.hs @@ -329,7 +329,7 @@ so they behave as global constants. Specifically: of Var.Var. The "tc" prefix means "a type variable that can be encountered by the typechecker". -This is a bit of a change from an earlier era when we remoselessly +This is a bit of a change from an earlier era when we remorselessly insisted on real TcTyVars in the type checker. But that seems unnecessary (for skolems, TyVars are fine) and it's now very hard to guarantee, with the advent of kind equalities. @@ -584,7 +584,7 @@ constraint solver. It's not strictly essential, and indeed (historically but still there) Var.tcTyVarDetails returns vanillaSkolemTv for a TyVar. -But ultimately I want to seeparate Type from TcType, and in that case +But ultimately I want to separate Type from TcType, and in that case we would need to enforce the separation. -} @@ -765,7 +765,7 @@ the constraint (C alpha[3]) disobeys WantedInv: (forall[3] b. alpha[3] ~ b) We can unify alpha:=b in the inner implication, because 'alpha' is -touchable; but then 'b' has excaped its scope into the outer implication. +touchable; but then 'b' has escaped its scope into the outer implication. -} maxTcLevel :: TcLevel -> TcLevel -> TcLevel @@ -1901,7 +1901,7 @@ boxEqPred eq_rel ty1 ty2 NomEq | homo_kind -> Just (eqClass, [k1, ty1, ty2]) | otherwise -> Just (heqClass, [k1, k2, ty1, ty2]) ReprEq | homo_kind -> Just (coercibleClass, [k1, ty1, ty2]) - | otherwise -> Nothing -- Sigh: we do not have hererogeneous Coercible + | otherwise -> Nothing -- Sigh: we do not have heterogeneous Coercible -- so we can't abstract over it -- Nothing fundamental: we could add it where diff --git a/compiler/GHC/Tc/Utils/Unify.hs b/compiler/GHC/Tc/Utils/Unify.hs index 1eb81d8191..af71c50156 100644 --- a/compiler/GHC/Tc/Utils/Unify.hs +++ b/compiler/GHC/Tc/Utils/Unify.hs @@ -205,7 +205,7 @@ Ugh! -- | Like 'matchExpectedFunTys', but used when you have an "actual" type, -- for example in function application. -- --- INVARIANT: the returned arguemnt types all have a syntactically fixed RuntimeRep +-- INVARIANT: the returned argument types all have a syntactically fixed RuntimeRep -- in the sense of Note [Fixed RuntimeRep] in GHC.Tc.Utils.Concrete. -- See Note [Return arguments with a fixed RuntimeRep]. matchActualFunTysRho :: ExpectedFunTyOrigin -- ^ See Note [Herald for matchExpectedFunTys] @@ -721,7 +721,7 @@ There is one wrinkle. Suppose we have case e of T1 -> e1 :: (forall a. a->a) -> Int G2 -> e2 -where T1 is not GADT or existential, but G2 is a GADT. Then supppose the +where T1 is not GADT or existential, but G2 is a GADT. Then suppose the T1 alternative fills the hole with (forall a. a->a) -> Int, which is fine. But now the G2 alternative must not *just* unify with that else we'd risk allowing through (e2 :: (forall a. a->a) -> Int). If we'd checked G2 first @@ -2219,7 +2219,7 @@ There are five reasons not to unify: assumptions", section 2.2. We say that alpha[1] is "untouchable" inside this implication. - Bottom line: at amibient level 'l', when looking at a constraint + Bottom line: at ambient level 'l', when looking at a constraint alpha[n] ~ ty, do not unify alpha := ty if there are any given equalities between levels 'n' and 'l'. @@ -2261,7 +2261,7 @@ There are five reasons not to unify: is sensible, but it can lead to very confusing error messages. It's very much like a Wanted rewriting a Wanted. Even worse, unifying a variable essentially turns an equality into a Given, - and so we could not use the tracking mechansim in + and so we could not use the tracking mechanism in Note [Wanteds rewrite Wanteds] in GHC.Tc.Types.Constraint. We thus simply do not unify in this case. diff --git a/compiler/GHC/Tc/Validity.hs b/compiler/GHC/Tc/Validity.hs index b5879940b0..3fbe32352b 100644 --- a/compiler/GHC/Tc/Validity.hs +++ b/compiler/GHC/Tc/Validity.hs @@ -362,7 +362,7 @@ This might not necessarily show up in kind checking. checkValidType :: UserTypeCtxt -> Type -> TcM () -- Checks that a user-written type is valid for the given context -- Assumes argument is fully zonked --- Assumes arugment is well-kinded; +-- Assumes argument is well-kinded; -- that is, checkValidType doesn't need to do kind checking -- Not used for instance decls; checkValidInstance instead checkValidType ctxt ty @@ -1379,7 +1379,7 @@ entirely different meaning. To illustrate, suppose in M.hsig we see instance KnownNat T That says that any module satisfying M.hsig must provide a KnownNat -instance for T. We absolultely need that instance when compiling a +instance for T. We absolutely need that instance when compiling a module that imports M.hsig: see #15379 and Note [Fabricating Evidence for Literals in Backpack] in GHC.Tc.Instance.Class. @@ -2505,7 +2505,7 @@ Note [Printing conflicts with class header] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It's remarkably painful to give a decent error message for conflicts with the class header. Consider - clase C b where + class C b where type F a b c instance C [b] where type F x Int _ _ = ... @@ -2557,7 +2557,7 @@ In every case, b is a type variable not determined by the LHS pattern. The first is caught by the renamer, but we catch the last two here. Perhaps one could argue that the second should be accepted, albeit with a warning, but consider the fact that in a type family instance, there is no way to interact -with such a varable. At least with @x :: forall a. Int@ we can use visibile +with such a varable. At least with @x :: forall a. Int@ we can use visible type application, like @x \@Bool 1@. (Of course it does nothing, but it is permissible.) In the type family case, the only sensible explanation is that the user has made a mistake -- thus we throw an error. diff --git a/compiler/GHC/Types/Demand.hs b/compiler/GHC/Types/Demand.hs index d4c8a5533d..8a207bd40e 100644 --- a/compiler/GHC/Types/Demand.hs +++ b/compiler/GHC/Types/Demand.hs @@ -270,7 +270,7 @@ Observation: Big record arguments (e.g., DynFlags) tend to be modified much less frequently than small records (e.g., Int). Result: Big records tend to be passed around boxed (unmodified) much more frequently than small records. -Consequnce: The larger the record, the more likely conditions (1) and (2) from +Consequence: The larger the record, the more likely conditions (1) and (2) from Note [Function body boxity and call sites] are met, in which case unboxing returned parameters leads to reboxing. @@ -1676,7 +1676,7 @@ is not strict in its argument: Just try this in GHCi catch undefined (\(_ :: SomeException) -> putStrLn "you'll see this") Any analysis that assumes otherwise will be broken in some way or another -(beyond `-fno-pendantic-bottoms`). +(beyond `-fno-pedantic-bottoms`). But then #13380 and #17676 suggest (in Mar 20) that we need to re-introduce a subtly different variant of `ThrowsExn` (which we call `ExnOrDiv` now) that is @@ -2075,8 +2075,8 @@ a demand on the Id into a DmdType, which gives c) an indication of the result of applying the Id to its arguments -However, in fact we store in the Id an extremely emascuated demand -transfomer, namely +However, in fact we store in the Id an extremely emasculated demand +transformer, namely a single DmdType (Nevertheless we dignify DmdSig as a distinct type.) diff --git a/compiler/GHC/Types/Hint.hs b/compiler/GHC/Types/Hint.hs index 3f8c3bbadf..31f8d4422b 100644 --- a/compiler/GHC/Types/Hint.hs +++ b/compiler/GHC/Types/Hint.hs @@ -63,7 +63,7 @@ data LanguageExtensionHint -- it's totally irrelevant/redundant for IDEs and other tools. SuggestSingleExtension !SDoc !LangExt.Extension -- | Suggest to enable the input extensions. The list - -- is to be intended as /disjuctive/ i.e. the user is + -- is to be intended as /disjunctive/ i.e. the user is -- suggested to enable /any/ of the extensions listed. If -- the input 'SDoc' is not empty, it will contain some extra -- information about the why the extensions are required, but diff --git a/compiler/GHC/Types/Id/Info.hs b/compiler/GHC/Types/Id/Info.hs index 381a48efd3..edd1ba0da0 100644 --- a/compiler/GHC/Types/Id/Info.hs +++ b/compiler/GHC/Types/Id/Info.hs @@ -255,7 +255,7 @@ A function with cbv-semantics requires arguments to be visible and if no arguments are visible requires us to eta-expand it's call site. That is for a binding with three cbv arguments like `w[WorkerLikeId[!,!,!]]` we would need to eta expand undersaturated -occurences like `map w xs` into `map (\x1 x2 x3 -> w x1 x2 x3) xs. +occurrences like `map w xs` into `map (\x1 x2 x3 -> w x1 x2 x3) xs. In experiments it turned out that the code size increase of doing so can outweigh the performance benefits of doing so. @@ -265,7 +265,7 @@ Join points are naturally always called saturated so this problem can't occur for them. For workers and specialized functions there are also always at least some applied arguments as we won't inline the wrapper/apply their rule -if there are unapplied occurances like `map f xs`. +if there are unapplied occurrences like `map f xs`. -} -- | Recursive Selector Parent diff --git a/compiler/GHC/Types/Id/Make.hs b/compiler/GHC/Types/Id/Make.hs index be10faaca3..7b7c2d6021 100644 --- a/compiler/GHC/Types/Id/Make.hs +++ b/compiler/GHC/Types/Id/Make.hs @@ -357,7 +357,7 @@ effect whether a wrapper is present or not: We'd like 'map Age' to match the LHS. For this to happen, Age must be unfolded, otherwise we'll be stuck. This is tested in T16208. -It also allows for the posssibility of representation-polymorphic newtypes +It also allows for the possibility of representation-polymorphic newtypes with wrappers (with -XUnliftedNewtypes): newtype N (a :: TYPE r) = MkN a @@ -1506,7 +1506,7 @@ wired in here ONLY because they are use in a representation-polymorphic way by the rebindable syntax mechanism. See GHC.Rename.Expr Note [Handling overloaded and rebindable constructs]. -Alas, we can't currenly give Haskell definitions for +Alas, we can't currently give Haskell definitions for representation-polymorphic functions. They have Compulsory unfoldings, so that the representation polymorphism diff --git a/compiler/GHC/Types/Literal.hs b/compiler/GHC/Types/Literal.hs index b525fc94df..fffb819a39 100644 --- a/compiler/GHC/Types/Literal.hs +++ b/compiler/GHC/Types/Literal.hs @@ -964,7 +964,7 @@ data type. Here are the moving parts: an IR feature. 2. Core: 'LitRubbish' carries a `Type` of kind RuntimeRep, - describing the runtime representaion of the literal (is it a + describing the runtime representation of the literal (is it a pointer, an unboxed Double#, or whatever). We have it that `RUBBISH[rr]` has type `forall (a :: TYPE rr). a`. @@ -1011,7 +1011,7 @@ data type. Here are the moving parts: Wrinkles a) Why do we put the `Type` (of kind RuntimeRep) inside the literal? Could - we not instead /apply/ the literal to that RuntimeRep? Alas no, becuase + we not instead /apply/ the literal to that RuntimeRep? Alas no, because then LitRubbish :: forall (rr::RuntimeRep) (a::TYPE rr). a and that's am ill-formed type because its kind is `TYPE rr`, which escapes the binding site of `rr`. Annoying. @@ -1043,7 +1043,7 @@ Suppose there is a bug in GHC, and a rubbish value is used after all. That is undefined behavior, of course, but let us list a few examples for failure modes: a) For an value of unboxed numeric type like `Int#`, we just use a silly - value like 42#. The error might propoagate indefinitely, hence we better + value like 42#. The error might propagate indefinitely, hence we better pick a rather unique literal. Same for Word, Floats, Char and VecRep. b) For AddrRep (like String lits), we mit a null pointer, resulting in a definitive segfault when accessed. diff --git a/compiler/GHC/Types/Name/Reader.hs b/compiler/GHC/Types/Name/Reader.hs index df624838c3..ece56cb5ec 100644 --- a/compiler/GHC/Types/Name/Reader.hs +++ b/compiler/GHC/Types/Name/Reader.hs @@ -711,7 +711,7 @@ greDefinitionModule = nameModule_maybe . greMangledName greQualModName :: GlobalRdrElt -> ModuleName -- Get a suitable module qualifier for the GRE -- (used in mkPrintUnqualified) --- Prerecondition: the greMangledName is always External +-- Precondition: the greMangledName is always External greQualModName gre@(GRE { gre_lcl = lcl, gre_imp = iss }) | lcl, Just mod <- greDefinitionModule gre = moduleName mod | Just is <- headMaybe iss = is_as (is_decl is) diff --git a/compiler/GHC/Types/RepType.hs b/compiler/GHC/Types/RepType.hs index 4aca238713..993694e1c3 100644 --- a/compiler/GHC/Types/RepType.hs +++ b/compiler/GHC/Types/RepType.hs @@ -525,7 +525,7 @@ GHC.Builtin.Types and its helper function mk_runtime_rep_dc.) Example 2 passes t list as the one argument to the extracted function. The extracted function is defined as prim_rep_fun within tupleRepDataCon in GHC.Builtin.Types. It takes one argument, decomposes the promoted list (with extractPromotedList), and then recurs back to runtimeRepPrimRep -to process the LiftedRep and WordRep, concatentating the results. +to process the LiftedRep and WordRep, concatenating the results. -} diff --git a/compiler/GHC/Types/SafeHaskell.hs b/compiler/GHC/Types/SafeHaskell.hs index 853676a9db..3653917008 100644 --- a/compiler/GHC/Types/SafeHaskell.hs +++ b/compiler/GHC/Types/SafeHaskell.hs @@ -43,7 +43,7 @@ instance Outputable SafeHaskellMode where ppr = text . show -- | Safe Haskell information for 'ModIface' --- Simply a wrapper around SafeHaskellMode to sepperate iface and flags +-- Simply a wrapper around SafeHaskellMode to separate iface and flags newtype IfaceTrustInfo = TrustInfo SafeHaskellMode getSafeMode :: IfaceTrustInfo -> SafeHaskellMode diff --git a/compiler/GHC/Types/SrcLoc.hs b/compiler/GHC/Types/SrcLoc.hs index 992f94f983..fdf4423544 100644 --- a/compiler/GHC/Types/SrcLoc.hs +++ b/compiler/GHC/Types/SrcLoc.hs @@ -160,7 +160,7 @@ data RealSrcLoc -- -- The parser guarantees that 'BufPos' are monotonic. See #17632. This means -- that syntactic constructs that appear later in the 'StringBuffer' are guaranteed to --- have a higher 'BufPos'. Constrast that with 'RealSrcLoc', which does *not* make the +-- have a higher 'BufPos'. Contrast that with 'RealSrcLoc', which does *not* make the -- analogous guarantee about higher line/column numbers. -- -- This is due to #line and {-# LINE ... #-} pragmas that can arbitrarily diff --git a/compiler/GHC/Types/Unique/Supply.hs b/compiler/GHC/Types/Unique/Supply.hs index 57dd8e10ab..26df32b535 100644 --- a/compiler/GHC/Types/Unique/Supply.hs +++ b/compiler/GHC/Types/Unique/Supply.hs @@ -158,7 +158,7 @@ and hardcode the mask into the MonadUnique instance. On top of all the benefits of threading the mask this *also* has the benefit of avoiding the mask getting captured in thunks, or being passed around at runtime. It does however come at the cost of having to use a fixed Mask for all -code run in this Monad. But rememeber, the Mask is purely cosmetic: +code run in this Monad. But remember, the Mask is purely cosmetic: See Note [Uniques and masks]. NB: It's *not* an optimization to pass around the UniqSupply inside an diff --git a/compiler/GHC/Unit.hs b/compiler/GHC/Unit.hs index 4affdc33c8..90223cd474 100644 --- a/compiler/GHC/Unit.hs +++ b/compiler/GHC/Unit.hs @@ -144,7 +144,7 @@ the latter case, the signatures are merged to form a new one. You can think of this as polymorphism at the module level: module signatures give constraints on the "type" of module that can be used to fill the hole -(where "type" means types of the exported module entitites, etc.). +(where "type" means types of the exported module entities, etc.). Module signatures contain enough information (datatypes, abstract types, type synonyms, classes, etc.) to typecheck modules depending on them but not diff --git a/compiler/GHC/Unit/Env.hs b/compiler/GHC/Unit/Env.hs index 5de8d90013..c2815dc234 100644 --- a/compiler/GHC/Unit/Env.hs +++ b/compiler/GHC/Unit/Env.hs @@ -552,7 +552,7 @@ The flow: a unit is identified by the -this-unit-id flag and dependencies specified by the normal -package-id flag. 2. Downsweep is augmented to know to know how to look for dependencies in any home unit. -3. The rest of the compiler is modified appropiately to offset paths to the right places. +3. The rest of the compiler is modified appropriately to offset paths to the right places. 4. --make mode can parallelise between home units and multiple units are allowed to produce linkables. Closure Property @@ -569,12 +569,12 @@ because q is a dependency of the home unit p which depends on another home unit Offsetting Paths ---------------- -The main complication to the implementation is to do with offsetting paths appropiately. +The main complication to the implementation is to do with offsetting paths appropriately. For a long time it has been assumed that GHC will execute in the top-directory for a unit, normally where the .cabal file is and all paths are interpreted relative to there. When you have multiple home units then it doesn't make sense to pick one of these units to choose as the base-unit, and you can't robustly change directories when -using parralelism. +using parallelism. Therefore there is an option `-working-directory`, which tells GHC where the relative paths for each unit should be interpreted relative to. For example, if you specify diff --git a/compiler/GHC/Unit/External.hs b/compiler/GHC/Unit/External.hs index 04af938c03..3d75103dbb 100644 --- a/compiler/GHC/Unit/External.hs +++ b/compiler/GHC/Unit/External.hs @@ -155,7 +155,7 @@ data ExternalPackageState eps_mod_fam_inst_env :: !(ModuleEnv FamInstEnv), -- ^ The family instances accumulated from external -- packages, keyed off the module that declared them - eps_stats :: !EpsStats -- ^ Stastics about what was loaded from external packages + eps_stats :: !EpsStats -- ^ Statistics about what was loaded from external packages } -- | Accumulated statistics about what we are putting into the 'ExternalPackageState'. diff --git a/compiler/GHC/Unit/Module/Env.hs b/compiler/GHC/Unit/Module/Env.hs index 32ca0b12cd..2fc0f9e9c1 100644 --- a/compiler/GHC/Unit/Module/Env.hs +++ b/compiler/GHC/Unit/Module/Env.hs @@ -73,7 +73,7 @@ To be on the safe side and not pessimize ModuleEnv uses nondeterministic ordering on Module and normalizes by doing the lexicographic sort when turning the env to a list. See Note [Unique Determinism] for more information about the source of -nondeterminismand and Note [Deterministic UniqFM] for explanation of why +nondeterminism and Note [Deterministic UniqFM] for explanation of why it matters for maps. -} diff --git a/compiler/GHC/Unit/Module/ModSummary.hs b/compiler/GHC/Unit/Module/ModSummary.hs index 6c0ff55627..35f52a5a3e 100644 --- a/compiler/GHC/Unit/Module/ModSummary.hs +++ b/compiler/GHC/Unit/Module/ModSummary.hs @@ -76,7 +76,7 @@ data ModSummary ms_textual_imps :: [(PkgQual, Located ModuleName)], -- ^ Non-source imports of the module from the module *text* ms_ghc_prim_import :: !Bool, - -- ^ Whether the special module GHC.Prim was imported explicitliy + -- ^ Whether the special module GHC.Prim was imported explicitly ms_parsed_mod :: Maybe HsParsedModule, -- ^ The parsed, nonrenamed source, if we have it. This is also -- used to support "inline module syntax" in Backpack files. diff --git a/compiler/GHC/Unit/State.hs b/compiler/GHC/Unit/State.hs index d7edd1268c..17d39d1590 100644 --- a/compiler/GHC/Unit/State.hs +++ b/compiler/GHC/Unit/State.hs @@ -538,13 +538,13 @@ lookupUnitId' :: UnitInfoMap -> UnitId -> Maybe UnitInfo lookupUnitId' db uid = Map.lookup uid db --- | Looks up the given unit in the unit state, panicing if it is not found +-- | Looks up the given unit in the unit state, panicking if it is not found unsafeLookupUnit :: HasDebugCallStack => UnitState -> Unit -> UnitInfo unsafeLookupUnit state u = case lookupUnit state u of Just info -> info Nothing -> pprPanic "unsafeLookupUnit" (ppr u) --- | Looks up the given unit id in the unit state, panicing if it is not found +-- | Looks up the given unit id in the unit state, panicking if it is not found unsafeLookupUnitId :: HasDebugCallStack => UnitState -> UnitId -> UnitInfo unsafeLookupUnitId state uid = case lookupUnitId state uid of Just info -> info diff --git a/compiler/GHC/Utils/Binary.hs b/compiler/GHC/Utils/Binary.hs index 5e11489572..5005fd4a73 100644 --- a/compiler/GHC/Utils/Binary.hs +++ b/compiler/GHC/Utils/Binary.hs @@ -779,7 +779,7 @@ We can easily do better. The new plan is: * Start with a tag byte * 0 => Int64 (LEB128 encoded) - * 1 => Negative large interger + * 1 => Negative large integer * 2 => Positive large integer * Followed by the value: * Int64 is encoded as usual diff --git a/compiler/GHC/Utils/Logger.hs b/compiler/GHC/Utils/Logger.hs index 7a33a91963..7cafeae2ff 100644 --- a/compiler/GHC/Utils/Logger.hs +++ b/compiler/GHC/Utils/Logger.hs @@ -9,7 +9,7 @@ -- hooks. The compiler itself uses hooks in multithreaded code (--make) and it -- is also probably used by ghc-api users (IDEs, etc.). -- --- In addition to hooks, the Logger suppors LogFlags: basically a subset of the +-- In addition to hooks, the Logger supports LogFlags: basically a subset of the -- command-line flags that control the logger behaviour at a higher level than -- hooks. -- diff --git a/compiler/GHC/Utils/Misc.hs b/compiler/GHC/Utils/Misc.hs index f09f0034be..e9f7685a92 100644 --- a/compiler/GHC/Utils/Misc.hs +++ b/compiler/GHC/Utils/Misc.hs @@ -970,10 +970,10 @@ fuzzyMatch key vals = fuzzyLookup key [(v,v) | v <- vals] -- | Search for possible matches to the users input in the given list, -- returning a small number of ranked results fuzzyLookup :: String -> [(String,a)] -> [a] -fuzzyLookup user_entered possibilites +fuzzyLookup user_entered possibilities = map fst $ take mAX_RESULTS $ List.sortBy (comparing snd) [ (poss_val, sort_key) - | (poss_str, poss_val) <- possibilites + | (poss_str, poss_val) <- possibilities , let distance = restrictedDamerauLevenshteinDistance poss_str user_entered , distance <= fuzzy_threshold , let sort_key = (distance, length poss_str, poss_str) diff --git a/compiler/GHC/Utils/Outputable.hs b/compiler/GHC/Utils/Outputable.hs index a9b8ca384e..1d8b962f71 100644 --- a/compiler/GHC/Utils/Outputable.hs +++ b/compiler/GHC/Utils/Outputable.hs @@ -800,12 +800,12 @@ vcat :: [SDoc] -> SDoc sep :: [SDoc] -> SDoc -- ^ Separate: is either like 'hsep' or like 'vcat', depending on what fits cat :: [SDoc] -> SDoc --- ^ Catenate: is either like 'hcat' or like 'vcat', depending on what fits +-- ^ Concatenate: is either like 'hcat' or like 'vcat', depending on what fits fsep :: [SDoc] -> SDoc -- ^ A paragraph-fill combinator. It's much like sep, only it -- keeps fitting things on one line until it can't fit any more. fcat :: [SDoc] -> SDoc --- ^ This behaves like 'fsep', but it uses '<>' for horizontal conposition rather than '<+>' +-- ^ This behaves like 'fsep', but it uses '<>' for horizontal composition rather than '<+>' -- Inline all those wrappers to help ensure we create lists of Doc, not of SDoc |