Commit 50512c6b authored by Gabor Greif's avatar Gabor Greif 💬

Typos in manual and comments

parent 08e73ccf
......@@ -1229,7 +1229,7 @@ diverge, and we do not anything being passed to b.
Note [Asymmetry of 'both' for DmdType and DmdResult]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'both' for DmdTypes is *assymetrical*, because there is only one
'both' for DmdTypes is *asymmetrical*, because there is only one
result! For example, given (e1 e2), we get a DmdType dt1 for e1, use
its arg demand to analyse e2 giving dt2, and then do (dt1 `bothType` dt2).
Similarly with
......
......@@ -180,7 +180,7 @@ coreExprToBCOs hsc_env this_mod expr
where dflags = hsc_dflags hsc_env
-- The regular freeVars function gives more information than is useful to
-- us here. simpleFreeVars does the impedence matching.
-- us here. simpleFreeVars does the impedance matching.
simpleFreeVars :: CoreExpr -> AnnExpr Id DVarSet
simpleFreeVars = go . freeVars
where
......
......@@ -60,7 +60,7 @@ data RegAllocStats statics instr
-- | Partially colored graph.
, raGraph :: Color.Graph VirtualReg RegClass RealReg
-- | The regs that were coaleced.
-- | The regs that were coalesced.
, raCoalesced :: UniqFM VirtualReg
-- | Spiller stats.
......@@ -84,7 +84,7 @@ data RegAllocStats statics instr
-- | Coalesced and colored graph.
, raGraphColored :: Color.Graph VirtualReg RegClass RealReg
-- | Regs that were coaleced.
-- | Regs that were coalesced.
, raCoalesced :: UniqFM VirtualReg
-- | Code with coalescings applied.
......
......@@ -790,7 +790,7 @@ the letrec.
{-
************************************************************************
* *
Impedence matching to type substitution
Impedance matching to type substitution
* *
************************************************************************
-}
......
......@@ -212,7 +212,7 @@ improveFromInstEnv inst_env mk_loc pred
-- because there often are none!
, let trimmed_tcs = trimRoughMatchTcs cls_tvs fd rough_tcs
-- Trim the rough_tcs based on the head of the fundep.
-- Remember that instanceCantMatch treats both argumnents
-- Remember that instanceCantMatch treats both arguments
-- symmetrically, so it's ok to trim the rough_tcs,
-- rather than trimming each inst_tcs in turn
, ispec <- instances
......
......@@ -831,7 +831,7 @@ mkExport prag_fn qtvs theta
; spec_prags <- tcSpecPrags poly_id prag_sigs
-- tcPrags requires a zonked poly_id
-- See Note [Impedence matching]
-- See Note [Impedance matching]
-- NB: we have already done checkValidType, including an ambiguity check,
-- on the type; either when we checked the sig or in mkInferredPolyId
; let poly_ty = idType poly_id
......@@ -843,7 +843,7 @@ mkExport prag_fn qtvs theta
then return idHsWrapper -- Fast path; also avoids complaint when we infer
-- an ambiguouse type and have AllowAmbiguousType
-- e..g infer x :: forall a. F a -> Int
else addErrCtxtM (mk_impedence_match_msg mono_info sel_poly_ty poly_ty) $
else addErrCtxtM (mk_impedance_match_msg mono_info sel_poly_ty poly_ty) $
tcSubType_NC sig_ctxt sel_poly_ty poly_ty
; warn_missing_sigs <- woptM Opt_WarnMissingLocalSignatures
......@@ -869,7 +869,7 @@ mkInferredPolyId qtvs inferred_theta poly_name mb_sig_inst mono_ty
| otherwise -- Either no type sig or partial type sig
= checkNoErrs $ -- The checkNoErrs ensures that if the type is ambiguous
-- we don't carry on to the impedence matching, and generate
-- we don't carry on to the impedance matching, and generate
-- a duplicate ambiguity error. There is a similar
-- checkNoErrs for complete type signatures too.
do { fam_envs <- tcGetFamInstEnvs
......@@ -966,11 +966,11 @@ chooseInferredQuantifiers inferred_theta tau_tvs qtvs
mk_ctuple preds = do { tc <- tcLookupTyCon (cTupleTyConName (length preds))
; return (mkTyConApp tc preds) }
mk_impedence_match_msg :: MonoBindInfo
mk_impedance_match_msg :: MonoBindInfo
-> TcType -> TcType
-> TidyEnv -> TcM (TidyEnv, SDoc)
-- This is a rare but rather awkward error messages
mk_impedence_match_msg (MBI { mbi_poly_name = name, mbi_sig = mb_sig })
mk_impedance_match_msg (MBI { mbi_poly_name = name, mbi_sig = mb_sig })
inf_ty sig_ty tidy_env
= do { (tidy_env1, inf_ty) <- zonkTidyTcType tidy_env inf_ty
; (tidy_env2, sig_ty) <- zonkTidyTcType tidy_env1 sig_ty
......@@ -1077,7 +1077,7 @@ Examples that might fail:
- an inferred type that includes unboxed tuples
Note [Impedence matching]
Note [Impedance matching]
~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
f 0 x = x
......
......@@ -243,7 +243,7 @@ subsumption, not equality, check against the context type. e.g.
Since 'blah' returns a value of type T, its payload is a polymorphic
function of type (forall a. a->a). And that's enough to bind the
less-polymorphic function 'f', but we need some impedence matching
less-polymorphic function 'f', but we need some impedance matching
to witness the instantiation.
......
......@@ -285,7 +285,7 @@ These don't have a name, so we can't quantify over them directly.
Instead, because we really do want to quantify here, invent a new
EvVar for the coercion, fill the hole with the invented EvVar, and
then quantify over the EvVar. Not too tricky -- just some
impedence matching, really.
impedance matching, really.
Note [Simplify cloned constraints]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -470,7 +470,7 @@ the signature types for f and g, we'll end up unifying 'a' and 'b'
So we instantiate f and g's signature with SigTv skolems
(newMetaSigTyVars) that can unify with each other. If too much
unification takes place, we'll find out when we do the final
impedence-matching check in TcBinds.mkExport
impedance-matching check in TcBinds.mkExport
See Note [Signature skolems] in TcType
......
......@@ -450,7 +450,7 @@ typeIsTypeable (CoercionTy{}) = panic "typeIsTypeable(Coercion)"
type KindRepEnv = TypeMap (Id, Maybe (LHsExpr Id))
-- | A monad within which we will generate 'KindRep's. Here we keep an
-- environments containing 'KindRep's which we've already generated so we can
-- environment containing 'KindRep's which we've already generated so we can
-- re-use them opportunistically.
newtype KindRepM a = KindRepM { unKindRepM :: StateT KindRepEnv TcRn a }
deriving (Functor, Applicative, Monad)
......
......@@ -118,7 +118,7 @@ and fail.
So in fact we use this as our *definition* of ambiguity. We use a
very similar test for *inferred* types, to ensure that they are
unambiguous. See Note [Impedence matching] in TcBinds.
unambiguous. See Note [Impedance matching] in TcBinds.
This test is very conveniently implemented by calling
tcSubType <type> <type>
......
......@@ -954,7 +954,7 @@ mentions the same name with different kinds, but it *is* well-kinded, noting
that `(tv1:k2) |> sym kind_co` has kind k1.
This all really would work storing just a Name in the ForAllCo. But we can't
add Names to, e.g., VarSets, and there generally is just an impedence mismatch
add Names to, e.g., VarSets, and there generally is just an impedance mismatch
in a bunch of places. So we use tv1. When we need tv2, we can use
setTyVarKind.
......
......@@ -45,7 +45,7 @@ colorGraph
-> ( Graph k cls color -- the colored graph.
, UniqSet k -- the set of nodes that we couldn't find a color for.
, UniqFM k ) -- map of regs (r1 -> r2) that were coaleced
, UniqFM k ) -- map of regs (r1 -> r2) that were coalesced
-- r1 should be replaced by r2 in the source
colorGraph iterative spinCount colors triv spill graph0
......
......@@ -279,7 +279,7 @@ addPreference (u, c) color
-- | Do aggressive coalescing on this graph.
-- returns the new graph and the list of pairs of nodes that got coaleced together.
-- returns the new graph and the list of pairs of nodes that got coalesced together.
-- for each pair, the resulting node will have the least key and be second in the pair.
--
coalesceGraph
......
......@@ -309,7 +309,7 @@ Functions can take multiple arguments as easily as they can take one
argument: there's no cost for adding another argument. But functions
can only return one result: the cost of adding a second ``result'' is
that the function must construct a tuple of ``results'' on the heap.
The assymetry is rather galling and can make certain programming
The asymmetry is rather galling and can make certain programming
styles quite expensive. For example, consider a simple state transformer
monad:
\begin{verbatim}
......
......@@ -974,14 +974,14 @@ The rules for map work like this.
* The "mapFB" rule optimises compositions of map
* The "mapFB/id" rule get rids of 'map id' calls.
* The "mapFB/id" rule gets rid of 'map id' calls.
You might think that (mapFB c id) will turn into c simply
when mapFB is inlined; but before that happens the "mapList"
rule turns
(foldr (mapFB (:) id) [] a
back into
map id
Which is not very cleveer.
Which is not very clever.
* Any similarity to the Functor laws for [] is expected.
-}
......
......@@ -103,7 +103,7 @@ import GHC.Types
-- separate copy of the data.
--
-- The cost of compaction is similar to the cost of GC for the same
-- data, but it is perfomed only once. However, because
-- data, but it is performed only once. However, because
-- "Data.Compact.compact" does not stop-the-world, retaining internal
-- sharing during the compaction process is very costly. The user
-- can choose whether to 'compact' or 'compactWithSharing'.
......
......@@ -169,7 +169,7 @@ split p = split' p []
spri (Ast x : Lex c : s) = opri c
spri s = 0
-- does any symbol appear in both consequent and antecedant of clause
-- does any symbol appear in both consequent and antecedent of clause
tautclause (c,a) = [x | x <- c, x `elem` a] /= []
-- form unique clausal axioms excluding tautologies
......
......@@ -2,7 +2,7 @@
{-# LANGUAGE FlexibleInstances #-}
-- | Same as SH_Overlap1, but module where overlap occurs (SH_Overlap3) is
-- marked `Unsafe`. Compilation should succeed (symetry with inferring safety).
-- marked `Unsafe`. Compilation should succeed (symmetry with inferring safety).
module SH_Overlap3 where
import SH_Overlap3_A
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment