Skip to content

Commit 6cb3612

Browse files
authored
Fix a few typos. (#3)
* Fix a few typos. * Update README.md * Update README.md
1 parent f165372 commit 6cb3612

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ print("\(helloWorld)!") // "Hello World!"
2929

3030
There are many applications of non-empty collection types but it can be hard to see since the Swift standard library does not give us this type. Here are just a few such applications:
3131

32-
### Strengthen 1st party API's
32+
### Strengthen 1st party APIs
3333

34-
Many API's take and return empty-able arrays when they can in fact guarantee that the arrays are non-empty. Consider a `groupBy` function:
34+
Many APIs take and return empty-able arrays when they can in fact guarantee that the arrays are non-empty. Consider a `groupBy` function:
3535

3636
```swift
3737
extension Sequence {
@@ -41,7 +41,7 @@ extension Sequence {
4141
}
4242

4343
Array(1...10)
44-
.groupBy { $0 % 3 == 0 }
44+
.groupBy { $0 % 3 }
4545
// [0: [3, 6, 9], 1: [1, 4, 7, 10], 2: [2, 5, 8]]
4646
```
4747

@@ -55,7 +55,7 @@ extension Sequence {
5555
}
5656
```
5757

58-
### Better interface with 3rd party API's
58+
### Better interface with 3rd party APIs
5959

6060
Sometimes a 3rd party API we interact with requires non-empty collections of values, and so in our code we should use non-empty types so that we can be sure to never send an empty values to the API. A good example of this is [GraphQL](https://graphql.org/). Here is a very simple query builder and printer:
6161

@@ -86,13 +86,13 @@ func query(_ fields: NonEmptySet<UserField>) -> String {
8686
.joined()
8787
}
8888

89-
print(query(.init([.name, .email])))
89+
print(query(.init(.name, .email)))
9090
// {
9191
// name
9292
// email
9393
// }
9494

95-
print(query(.init([])))
95+
print(query(.init()))
9696
// 🛑 Does not compile
9797
```
9898

0 commit comments

Comments
 (0)