Skip to content

Commit

Permalink
Update Episode 6’s Exercises page to match transcript. (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasdev authored and mbrandonw committed Jan 20, 2020
1 parent 3bdd72e commit 9320cc1
Showing 1 changed file with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,42 @@
*/
// TODO
/*:
2. Take the following `User` struct and write a setter for its `name` property. Add another property, and add a setter for it. What are some potential issues with building these setters?
*/
2. Take a `struct`, _e.g._:

```
struct User {
let name: String
}
```

Write a setter for its property. Take (or add) another property, and add a setter for it. What are some potential issues with building these setters?
*/
// TODO
/*:
3. Add a `location` property to `User`, which holds a `Location`, defined below. Write a setter for `userLocationName`. Now write setters for `userLocation` and `locationName`. How do these setters compose?
*/
3. Take a `struct` with a nested `struct`, _e.g._:

```
struct Location {
let name: String
}
// TODO
/*:
4. Do `first` and `second` work with tuples of three or more values? Can we write `first`, `second`, `third`, and `nth` for tuples of _n_ values?

struct User {
let location: Location
}
```

Write a setter for `userLocationName`. Now write setters for `userLocation` and `locationName`. How do these setters compose?
*/
// TODO
/*:
5. Write a setter for a dictionary that traverses into a key to set a value.
4. Do `first` and `second` work with tuples of three or more values? Can we write `first`, `second`,`third`, and `nth` for tuples of _n_ values?
*/
// TODO
/*:
6. Write a setter for a dictionary that traverses into a key to set a value if and only if that value already exists.
5. Write a setter for a dictionary that traverses into a key to set a value.
*/
// TODO
/*:
7. What is the difference between a function of the form `((A) -> B) -> (C) -> (D)` and one of the form `(A) -> (B) -> (C) -> D`?
6. What is the difference between a function of the form `((A) -> B) -> (C) -> (D)` and one of the form `(A) -> (B) -> (C) -> D`?
*/
// TODO

0 comments on commit 9320cc1

Please sign in to comment.