File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ When you need to deal with failure, you have several options.
110
110
2 . ** Alt**
111
111
3 . ** MonadError**
112
112
113
- ### 1. Attempt
113
+ #### 1. Attempt
114
114
115
115
If you want to attempt a computation but recover from failure, you can use the ` attempt ` function:
116
116
@@ -125,7 +125,7 @@ do e <- attempt $ Ajax.get "http://foo.com"
125
125
liftEff $ either (const $ trace "Oh noes!") (const $ trace "Yays!") e
126
126
```
127
127
128
- ### 2. Alt
128
+ #### 2. Alt
129
129
130
130
Because ` Aff ` has an ` Alt ` instance, you may also use the operator ` <|> ` to provide an alternative computation in the event of failure:
131
131
@@ -134,7 +134,7 @@ do result <- Ajax.get "http://foo.com" <|> Ajax.get "http://bar.com"
134
134
return result
135
135
```
136
136
137
- ### 3. MonadError
137
+ #### 3. MonadError
138
138
139
139
` Aff ` has a ` MonadError ` instance, which comes with two functions: ` catchError ` , and ` throwError ` .
140
140
You can’t perform that action at this time.
0 commit comments