-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filling out functionality, tests, and readme
- Loading branch information
1 parent
dceab50
commit b42fb5c
Showing
9 changed files
with
617 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
# Either | ||
# Yet Another `Either` Type! 🥳 | ||
|
||
Did the world need another Swift `Either` type? No. | ||
Are We suffering from Not-Invented-Here Syndrome? Maybe. | ||
Did We still think this was a good idea? Definitely. | ||
|
||
`Either` is a concept in many functional and strongly-typed languages which allows a value of **either** one type or another, to be stored in one field: | ||
|
||
```swift | ||
/// A response for the population query | ||
struct PopulationResponse { | ||
|
||
/// The list of people in the population | ||
/// | ||
/// - Note: In 1.x, this was a list of names as `String`s. | ||
/// In 2.x and newer, this is a map of UUIDs to `Person` objects | ||
let people: Either<[String], [UUID: Person]> | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.