Skip to content

Commit 3e47db8

Browse files
committed
Correction to satisfy own internal pedant
1 parent 0a29f74 commit 3e47db8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

slides/lesson4-task-either.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Either<E, A> =
99
| { type: 'Right'; value: A }
1010
```
1111
12-
- Now that's all well and good, until we want do __do__ something, like fetch
12+
- Now that's all well and good, until we want do **do** something, like fetch
1313
from an API or fire nuclear warheads.
1414
1515
- That's what we use `Promises` for right?
@@ -65,7 +65,7 @@ cousins `async` and `await` are excellent ways to unclutter asynchronous code.
6565
## Typing the fail rail
6666

6767
So a thing about `Monads`, which are a thing we've been using, but not boasting
68-
about it because we're not jerks, is that they can also be composed.
68+
about it because we're not jerks, is that they can also be combined.
6969

7070
- We could have `ReaderOption<R,A>`, which provides a read only environment of
7171
type `R` and an `A` value, that may or may not exist.
@@ -128,7 +128,7 @@ type ApiReturn = { code: number; description: string }
128128
// businessValue :: TaskEither String (AxiosResponse ApiReturn)
129129
const businessValue = TE.tryCatch(
130130
() => axios.get('https://httpstat.us/200'),
131-
(reason) => new Error(`${reason}`)
131+
reason => new Error(`${reason}`)
132132
)
133133
```
134134

@@ -156,7 +156,7 @@ Our `businessValue` function returns either a `String` error or
156156
// betterBusinessValue :: TaskEither String ApiReturn
157157
const betterBusinessValue = pipe(
158158
businessValue,
159-
TE.map((resp) => resp.data)
159+
TE.map(resp => resp.data)
160160
)
161161
```
162162

@@ -168,8 +168,8 @@ const betterBusinessValue = pipe(
168168
// businessNumber :: TaskEither String Number
169169
const businessNumber = pipe(
170170
businessValue,
171-
TE.map((resp) => resp.data),
172-
TE.map((apiReturn) => apiReturn.code)
171+
TE.map(resp => resp.data),
172+
TE.map(apiReturn => apiReturn.code)
173173
)
174174
```
175175

0 commit comments

Comments
 (0)