@@ -9,7 +9,7 @@ type Either<E, A> =
9
9
| { type: ' Right' ; value: A }
10
10
` ` `
11
11
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
13
13
from an API or fire nuclear warheads.
14
14
15
15
- That's what we use ` Promises ` for right?
@@ -65,7 +65,7 @@ cousins `async` and `await` are excellent ways to unclutter asynchronous code.
65
65
## Typing the fail rail
66
66
67
67
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 .
69
69
70
70
- We could have ` ReaderOption<R,A> ` , which provides a read only environment of
71
71
type ` R ` and an ` A ` value, that may or may not exist.
@@ -128,7 +128,7 @@ type ApiReturn = { code: number; description: string }
128
128
// businessValue :: TaskEither String (AxiosResponse ApiReturn)
129
129
const businessValue = TE .tryCatch (
130
130
() => axios .get (' https://httpstat.us/200' ),
131
- ( reason ) => new Error (` ${reason } ` )
131
+ reason => new Error (` ${reason } ` )
132
132
)
133
133
```
134
134
@@ -156,7 +156,7 @@ Our `businessValue` function returns either a `String` error or
156
156
// betterBusinessValue :: TaskEither String ApiReturn
157
157
const betterBusinessValue = pipe (
158
158
businessValue ,
159
- TE .map (( resp ) => resp .data )
159
+ TE .map (resp => resp .data )
160
160
)
161
161
```
162
162
@@ -168,8 +168,8 @@ const betterBusinessValue = pipe(
168
168
// businessNumber :: TaskEither String Number
169
169
const businessNumber = pipe (
170
170
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 )
173
173
)
174
174
```
175
175
0 commit comments