Jacek Sieka d2ae2889e8
Result refresh (#96)
* `Result` refresh

* add full support for `Result[T, void]` (aka `Opt[T]` aka `Option[T]`)
* expand tests
* add `flatten`, `filter` of `Option` fame
* add `tryError` that raises a regular exception when result holds a
value
* fix `$` to print `ok`/`err` in lower-case, like the functions that
created the result
* add `orErr` that collapses all errors to a single value of a
potentially different type - useful when translating errors between
layers
* `capture` should work with `CatchableError`
* remove `Defect`-dependent tests

* Update stew/results.nim

* avoid redundant error message when converting error to string
* avoid multiple evaluation in `valueOr`
* add `unsafeError` to match `unsafeGet`
* let `valueOr` evaluate a block
* add `errorOr` to mirror `valueOr`
2022-01-10 00:22:09 +02:00
..
2021-12-02 16:24:02 +01:00
2021-12-03 13:30:06 +02:00
2021-04-16 15:23:36 +02:00
2021-12-02 16:24:02 +01:00
2021-12-02 16:24:02 +01:00
2021-12-02 16:24:02 +01:00
2021-12-02 16:24:02 +01:00
2021-12-02 16:24:02 +01:00
2021-12-02 16:24:02 +01:00
2019-07-06 19:12:24 +02:00
2021-01-26 14:10:47 +01:00
2021-12-02 16:24:02 +01:00
2020-12-15 17:07:20 +02:00
2021-12-02 16:24:02 +01:00
2020-06-03 11:22:32 +02:00
2020-05-07 07:11:43 +02:00
2019-07-06 19:12:24 +02:00
2020-04-07 11:43:07 +02:00
2022-01-10 00:22:09 +02:00
2020-06-25 19:01:01 +02:00
2020-12-10 12:05:22 +01:00
2021-12-02 16:24:02 +01:00
2021-12-02 16:24:02 +01:00
2021-12-02 16:24:02 +01:00

Candidates for standard library inclusion - functions and helpers that are too small to put in their own git repository