Commit 7f9e362
Try to recover from effectful code that is annotated as pure (#173)
This puts a try-catch around the bind step in order to try to catch code
that is not expected to have effects but does (by throwing).
While this is clearly a programming error, it is certainly not
implausible that effects creep into FFI code inadvertently for Aff
users. This allows us to be defensive in that case and recover, rather
than have all asynchronous options quitely not work after.
The addition of the try-catch does not seem to have a performance impact
(tested on Node v10.15.3). With and without this change, `pulp test`
takes ~4.8s to run.
There is a discussion around this on #172.1 parent 390857f commit 7f9e362
1 file changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
| |||
0 commit comments