Skip to content

Commit 0213f2d

Browse files
authored
Spelling docs (#42437)
* spelling: any Signed-off-by: Josh Soref <[email protected]> * spelling: associated Signed-off-by: Josh Soref <[email protected]> * spelling: async Signed-off-by: Josh Soref <[email protected]> * spelling: classes Signed-off-by: Josh Soref <[email protected]> * spelling: clonability Signed-off-by: Josh Soref <[email protected]> * spelling: conspicuously Signed-off-by: Josh Soref <[email protected]> * spelling: constituent Signed-off-by: Josh Soref <[email protected]> * spelling: constraint Signed-off-by: Josh Soref <[email protected]> * spelling: contains Signed-off-by: Josh Soref <[email protected]> * spelling: definition Signed-off-by: Josh Soref <[email protected]> * spelling: digestible Signed-off-by: Josh Soref <[email protected]> * spelling: for Signed-off-by: Josh Soref <[email protected]> * spelling: github Signed-off-by: Josh Soref <[email protected]> * spelling: javascript Signed-off-by: Josh Soref <[email protected]> * spelling: manually Signed-off-by: Josh Soref <[email protected]> * spelling: much Signed-off-by: Josh Soref <[email protected]> * spelling: multi Signed-off-by: Josh Soref <[email protected]> * spelling: occasionally Signed-off-by: Josh Soref <[email protected]> * spelling: outputs Signed-off-by: Josh Soref <[email protected]> * spelling: overriding Signed-off-by: Josh Soref <[email protected]> * spelling: partition Signed-off-by: Josh Soref <[email protected]> * spelling: propagation Signed-off-by: Josh Soref <[email protected]> * spelling: protocol Signed-off-by: Josh Soref <[email protected]> * spelling: quandary Signed-off-by: Josh Soref <[email protected]> * spelling: redundant Signed-off-by: Josh Soref <[email protected]> * spelling: responsible Signed-off-by: Josh Soref <[email protected]> * spelling: right Signed-off-by: Josh Soref <[email protected]> * spelling: specifically Signed-off-by: Josh Soref <[email protected]> * spelling: suppose Signed-off-by: Josh Soref <[email protected]> * spelling: that Signed-off-by: Josh Soref <[email protected]> * spelling: the Signed-off-by: Josh Soref <[email protected]> * spelling: with Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Josh Soref <[email protected]>
1 parent 5fab3d1 commit 0213f2d

20 files changed

+39
-39
lines changed

docs/ABI/Mangling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ witness functions for a type.
305305
AUTODIFF-FUNCTION-KIND ::= 'd' // differential
306306
AUTODIFF-FUNCTION-KIND ::= 'p' // pullback
307307

308-
``<AUTODIFF-FUNCTION-KIND>`` differentiates the kinds of functions assocaited
308+
``<AUTODIFF-FUNCTION-KIND>`` differentiates the kinds of functions associated
309309
with a differentiable function used for differentiable programming.
310310

311311
::
@@ -596,7 +596,7 @@ Types
596596
FUNCTION-KIND ::= 'zB' C-TYPE // objc block type with non-canonical C type
597597
FUNCTION-KIND ::= 'L' // objc block function type with canonical C type (escaping) (DWARF only; otherwise use 'B' or 'zB' C-TYPE)
598598
FUNCTION-KIND ::= 'C' // C function pointer / C++ method type
599-
FUNCTION-KIND ::= 'zC' C-TYPE // C function pointer / C++ method type with with non-canonical C type
599+
FUNCTION-KIND ::= 'zC' C-TYPE // C function pointer / C++ method type with non-canonical C type
600600
FUNCTION-KIND ::= 'A' // @auto_closure function type (escaping)
601601
FUNCTION-KIND ::= 'E' // function type (noescape)
602602

docs/CppInteroperability/CppInteroperabilityManifesto.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ is ergonomics.
16251625
16261626
While Swift structs are a bad match for non-movable C++ classes, Swift classes
16271627
match semantics better. For example, instances of Swift classes, once allocated,
1628-
stay at the same address until `deinit`. Instances of Swift clasess are always
1628+
stay at the same address until `deinit`. Instances of Swift classes are always
16291629
worked with indirectly, eliminating the need to move them around in memory.
16301630
16311631
Although user-defined Swift classes have a certain memory layout determined by
@@ -2524,7 +2524,7 @@ there the Swift compiler infers the attribute for all users.
25242524
This analysis relies on over-approximating the dynamic callgraph with the static
25252525
callgraph. The static callgraph is feasible to compute in most cases, since
25262526
Swift has very limited ways to abstract over an unspecialized generic function.
2527-
Speicifically, Swift does not have generic closures. Swift does allow protocols
2527+
Specifically, Swift does not have generic closures. Swift does allow protocols
25282528
to have requirements for generic functions though.
25292529

25302530
### Function templates: importing as real generic functions
@@ -2963,7 +2963,7 @@ This brief sketch obviously leaves many questions unanswered on the detailed
29632963
semantics that a `throws!` feature would have, for example whether user-written
29642964
Swift code should be allowed to use `throws!` -- see also [this forum
29652965
discussion](https://forums.swift.org/t/handling-c-exceptions/34823). Before we
2966-
take any steps towards implementing C++ exception proagation, we will submit a
2966+
take any steps towards implementing C++ exception propagation, we will submit a
29672967
formal Swift Evolution proposal for the `throws!` feature.
29682968

29692969
The other question to answer is how we would map the C++ exception to a

docs/CppInteroperability/GettingStartedWithC++Interop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This document is designed to get you started with bidirectional API-level intero
1818
```
1919
//In module.modulemap
2020
module Cxx {
21-
//note that your header should be the file that containts your method implementations
21+
//note that your header should be the file that contains your method implementations
2222
header "Cxx.hpp"
2323
requires cplusplus
2424
}

docs/CppInteroperability/InteropOddities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ are bridged as value types. ⚠️ This will change as soon as Swift has a way t
1212

1313
Currently, lifetimes are extended to the end of the lexical scope if any unsafe pointers are used in that scope. TODO:
1414
this should be updated to extend lifetimes whenever a C++ type is used in that scope. Currently, if there is no
15-
unsafe pointer used in teh scope, then normal Swift lifetime rules apply.
15+
unsafe pointer used in the scope, then normal Swift lifetime rules apply.
1616

1717
**Borrowing Self**
1818

docs/DebuggingTheCompiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ find MyProject/Sources -name '*.swift' -type f > input-files.txt
599599
# In some cases, projects may use multiple files with the same
600600
# name but in different directories (for different schemes),
601601
# which can be a problem. Having a file list makes working around
602-
# this convenient as you can manually manually edit out the files
602+
# this convenient as you can manually edit out the files
603603
# that are not of interest at this stage.
604604
605605
mkdir Output

docs/DevelopmentTips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Given the size of artifacts generated, you might also want to bump the cache siz
4242

4343
You can run some compiles to see if it is actually doing something by running `sccache --show-stats`. Depending on the exact compilation task you're running, you might see very different cache hit rates. For example, `sccache` is particularly effective if you're rebuilding LLVM, which doesn't change so frequently from the Swift compiler's perspective. On the other hand, if you're changing the compiler's AST, the cache hit rate is likely to be much lower.
4444

45-
One known issue with `sccache` is that you might occassionally get an "error: Connection to server timed out", even though you didn't stop the server. Simply re-running the build command usually works.
45+
One known issue with `sccache` is that you might occasionally get an "error: Connection to server timed out", even though you didn't stop the server. Simply re-running the build command usually works.
4646

4747
## Memory usage
4848

docs/Lexicon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Describes contributions which fix code that is not executed
239239
Provides context for interpreting a type that may have generic parameters
240240
in it. Generic parameter types are normally just represented as "first
241241
generic parameter in the outermost context" (or similar), so it's up to the
242-
generic environment to note that that type must be a Collection. (Another
242+
generic environment to note that type must be a Collection. (Another
243243
way of looking at it is that the generic environment connects
244244
[interface types](#interface-type) with
245245
[contextual types](#contextual-type)).

docs/OptimizationTips.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ sources all together at once. This allows the optimizer to have module
183183
wide visibility when compiling individual declarations. Since an
184184
internal declaration is not visible outside of the current module, the
185185
optimizer can then infer `final` by automatically discovering all
186-
potentially overridding declarations.
186+
potentially overriding declarations.
187187

188188
NOTE: Since in Swift the default access control level is ``internal``
189189
anyways, by enabling Whole Module Optimization, one can gain

docs/OwnershipManifesto.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ called function where it isn't obviously using its `inout`
393393
argument. Perhaps we should track accesses to `inout` arguments
394394
at a finer-grained level, within the callee, instead of attempting
395395
to enforce the Law of Exclusivity in the caller. The problem
396-
is that that idea is simply too dynamic to be efficiently
396+
is that idea is simply too dynamic to be efficiently
397397
implemented.
398398

399399
A caller-side rule for `inout` has one key advantage: the
@@ -1163,7 +1163,7 @@ here because, as mentioned above, the entire co-routine
11631163
must logically execute within the scope of an access to the
11641164
base value. If, as is common for generators, the generator
11651165
function actually returns some sort of generator object,
1166-
the compiler must ensure that that object does not escape
1166+
the compiler must ensure that object does not escape
11671167
that enclosing access. This is a significant source of
11681168
complexity.
11691169

docs/ReferenceGuides/UnderscoredAttributes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ available for emission into clients with deployment targets lower than the
4646
ABI availability of the function. When the client's deployment target is
4747
before the function's ABI availability, the compiler replaces calls to that
4848
function with a call to a thunk that checks at runtime whether the original
49-
library function is available. If the the original is available then it is
49+
library function is available. If the original is available then it is
5050
called. Otherwise, the fallback copy of the function that was emitted into the
5151
client is called instead.
5252

@@ -640,7 +640,7 @@ Here are the necessary changes:
640640
This ensures when an app is built for deployment targets prior to the symbols' move,
641641
the app will look for these symbols in ToasterKit instead of ToasterKitCore.
642642

643-
More generally, mutliple availabilities can be specified, like so:
643+
More generally, multiple availabilities can be specified, like so:
644644

645645
```swift
646646
@available(toasterOS 42, bowlOS 54, mugOS 54, *)

docs/RequirementMachine/RequirementMachine.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ \chapter{Language Overview}\label{languageoverview}
218218
\end{Verbatim}
219219
A particularly powerful kind of generic requirement---and perhaps the entire reason the requirement machine exists---is the same-type requirement.
220220

221-
Supppose you're working with $\genericparam{S}$, a generic parameter ranging over $\proto{Sequence}$. Writing $\genericparam{S}.\namesym{Iterator}.\namesym{Element}$ everywhere will get awkward fast. As I mentioned, the real version of $\proto{Sequence}$ in the standard library is slightly more complex. Indeed, it defines an $\namesym{Element}$ associated type in the protocol itself, so that the user can write $\genericparam{S}.\namesym{Element}$. Simply adding the associated type definition is not enough, because now $\genericparam{S}.\namesym{Element}$ and $\genericparam{S}.\namesym{Iterator}.\namesym{Element}$ are \emph{different} type parameters and cannot be used interchangeably.
221+
Suppose you're working with $\genericparam{S}$, a generic parameter ranging over $\proto{Sequence}$. Writing $\genericparam{S}.\namesym{Iterator}.\namesym{Element}$ everywhere will get awkward fast. As I mentioned, the real version of $\proto{Sequence}$ in the standard library is slightly more complex. Indeed, it defines an $\namesym{Element}$ associated type in the protocol itself, so that the user can write $\genericparam{S}.\namesym{Element}$. Simply adding the associated type definition is not enough, because now $\genericparam{S}.\namesym{Element}$ and $\genericparam{S}.\namesym{Iterator}.\namesym{Element}$ are \emph{different} type parameters and cannot be used interchangeably.
222222

223223
\index{same-type requirement}
224224
To express this restriction that concrete types conforming to $\proto{Sequence}$ must provide an iterator type compatible with the element type, a \texttt{where} clause in the protocol can state a same-type requirement:
@@ -261,7 +261,7 @@ \chapter{Language Overview}\label{languageoverview}
261261
\[\genericparam{T}.\namesym{Element} == \namesym{Int}.\]
262262

263263
\index{power set}
264-
One more small language feature is worth mentioning. You might want to define a function that constructs the the set of all subsets of a set, i.e., the power set. The $\namesym{Set}\langle\bullet\rangle$ type constructor requires that its argument conforms to $\proto{Hashable}$:
264+
One more small language feature is worth mentioning. You might want to define a function that constructs the set of all subsets of a set, i.e., the power set. The $\namesym{Set}\langle\bullet\rangle$ type constructor requires that its argument conforms to $\proto{Hashable}$:
265265
\begin{Verbatim}
266266
struct Set<Element : Hashable> {...}
267267
\end{Verbatim}
@@ -1390,7 +1390,7 @@ \chapter{Rewrite Systems}\label{rewritesystemintro}
13901390
\begin{definition}[Reduction relation]\label{transinvdef} If $A^*$ is equipped with a reduction order $<$, then a relation $\rightarrow$ is a \emph{reduction relation} with respect to $<$ if $x\rightarrow y$ implies that $y<x$. Another equivalent definition is that a reduction relation $\rightarrow$ is a \emph{sub-relation} of $>$, the inverse relation of $<$.
13911391
\end{definition}
13921392
\index{rewrite system}
1393-
As you saw in the previous example, a reduction relation for a finitely-presented monoid can be constructed by orienting the equations from the presentation with respect to some reduction order, a process which converts the equations into rewrite rules. Such a set of rewrite rules is called a \emph{rewrite system}. There is a simple algorithm for for reducing a term into an irreducible form:
1393+
As you saw in the previous example, a reduction relation for a finitely-presented monoid can be constructed by orienting the equations from the presentation with respect to some reduction order, a process which converts the equations into rewrite rules. Such a set of rewrite rules is called a \emph{rewrite system}. There is a simple algorithm for reducing a term into an irreducible form:
13941394
\begin{algorithm}[Reducing a term]\label{reducingaterm} Let $t$ be a term in some rewrite system $R$.
13951395
\begin{enumerate}
13961396
\item Initialize the boolean flag to false.
@@ -2208,7 +2208,7 @@ \chapter{Associated Types}\label{associatedtypes}
22082208
u&\leftrightarrow a\\
22092209
v&\leftrightarrow b
22102210
\end{align*}
2211-
This means that adding a new \emph{generator} to $M$ made the presentation convergent. What does this generator represent in the world of Swift? Well, $u\in M'$ is $a\in M$, which is $\protosym{View}$ in Swift; and $v\in M'$ is $b\in M$, which is $\namesym{Body}$. Therefore $t\in M'$ is $ab\in M$, which is $\protosym{View}.\namesym{Body}$. You may guess that $t$ could be a new kind of symbol, perhaps representing a ``bound'' associated type inside a specific protcol.
2211+
This means that adding a new \emph{generator} to $M$ made the presentation convergent. What does this generator represent in the world of Swift? Well, $u\in M'$ is $a\in M$, which is $\protosym{View}$ in Swift; and $v\in M'$ is $b\in M$, which is $\namesym{Body}$. Therefore $t\in M'$ is $ab\in M$, which is $\protosym{View}.\namesym{Body}$. You may guess that $t$ could be a new kind of symbol, perhaps representing a ``bound'' associated type inside a specific protocol.
22122212

22132213
\index{associated type symbol}
22142214
The crux of the issue is that name symbols like $\namesym{Body}$ don't carry any information, and little can be said about them unless they're prefixed with some other term that is known to conform to a protocol. Thus, you cannot simply add a rewrite rule to say that $\namesym{Body}$ conforms to $\protosym{View}$:
@@ -2369,7 +2369,7 @@ \chapter{Associated Types}\label{associatedtypes}
23692369
\end{proof}
23702370

23712371
\iffalse
2372-
This solves the quandry presented at the beginning of this chapter, where the earlier formulation of the rewrite system that lacked associated type symbols had no apparent way of implementing the \texttt{getCanonicalTypeInContext()} generic signature query.
2372+
This solves the quandary presented at the beginning of this chapter, where the earlier formulation of the rewrite system that lacked associated type symbols had no apparent way of implementing the \texttt{getCanonicalTypeInContext()} generic signature query.
23732373

23742374
Now that a term containing name symbols reduces to a canonical term with associated type symbols, it appears that mapping terms back to fully resolved type parameters is now a possibility. Unfortunately, the reality is a little bit more complicated. The inherited associated type construction I will introduce in the next section once again breaks the correspondence between terms and canonical types; this will be repaired in Section \ref{implqueries}.
23752375
\fi
@@ -3674,7 +3674,7 @@ \section{Generic Signature Queries}\label{implqueries}
36743674
\item[\texttt{getRequiredProtocols()}] The list of protocol requirements satisfied by a type parameter $T$ is recorded in the form of protocol symbols in the property map. This list is transformed into a minimal canonical list of protocols using Definition~\ref{minimalproto}.
36753675
\index{layout constraints}
36763676
\index{join of layout constraints}
3677-
\item[\texttt{getLayoutContraint()}] A type parameter $T$ might be subject to multiple layout constraints, in which case the property map entry will store a list of layout constraints $L_1,\ldots,L_n$. This query needs to compute their join, which is the largest layout constraint that simultaneously satisfies all of them:
3677+
\item[\texttt{getLayoutConstraint()}] A type parameter $T$ might be subject to multiple layout constraints, in which case the property map entry will store a list of layout constraints $L_1,\ldots,L_n$. This query needs to compute their join, which is the largest layout constraint that simultaneously satisfies all of them:
36783678
\[L_1\wedge\cdots\wedge L_n.\]
36793679
Some layout constraints are disjoint on concrete types, meaning their join is the uninhabited ``bottom'' layout constraint, which precedes all other layout constraints in the partial order. In this case, the original generic signature is said to have conflicting requirements. While such a signature does not violate the requirement machine's invariants, it cannot be satisfied by any valid set of concrete substitutions. Detecting and diagnosing conflicting requirements is discussed later.
36803680

0 commit comments

Comments
 (0)