Oliver Gugger
f42636fec9
Merge pull request #8985 from ProofOfKeags/fn/collect-results
...
fn: more fn goodies
2024-11-07 18:50:57 +01:00
Keagan McClelland
dd7f1569c7
fn: breaking - rename ChainOption to FlatMapOption for consistency
2024-11-06 17:32:59 -07:00
Keagan McClelland
1480287cfc
fn: breaking - improve naming of option api functions
2024-11-06 17:32:59 -07:00
Keagan McClelland
a026d64c1b
fn: breaking - fix type variables for better inference
2024-11-06 16:50:06 -07:00
Keagan McClelland
5dec35426c
fn: add transpositions for Option and Result
2024-11-06 16:40:36 -07:00
Keagan McClelland
5faad77f33
fn: add conversions between Result and Option
2024-11-06 16:39:33 -07:00
Keagan McClelland
7a7f3bdb2c
fn: fix UnwrapOrFail semantics
2024-11-06 15:55:18 -07:00
ffranr
71298f7614
fn: fix documentation comment for Option
...
Remove the type generic from the `Option` type struct in the doc
comment.
2024-10-29 20:16:20 +00:00
ffranr
c49d038540
fn: add OptionFromPtr function
...
Add a function `OptionFromPtr` that constructs an `Option` from a
pointer. The function signature is: `OptionFromPtr : *A -> Option[A]`.
This utility has proven useful in the taproot-assets project.
2024-10-29 20:16:20 +00:00
Keagan McClelland
c4df2f1dce
fn: reimplement internals of either, add tests
2024-07-10 15:37:27 -07:00
Keagan McClelland
1dd56f1b2a
fn: fix and finish the either API
2024-07-10 15:37:27 -07:00
Olaoluwa Osuntokun
166b2fdb97
fn: add UnwrapOrErr and UnwrapOrFail to Option
...
In this commit, we add two new methods that simplify usage of an
handling a value wrapped in an Option. Thes methods allow a caller to
force the nil/None check up front, and either obtain the value, or fail
the current execution or test.
This should replace most usages of `UnsafeFromSome` where ever used
today.
2024-02-24 17:21:37 -08:00
Olaoluwa Osuntokun
1d1c1382d0
fn: add utility funcs/method for option type
2024-01-23 19:09:59 -08:00
Keagan McClelland
2499813414
fn: add UnsafeFromSome to Option API
2024-01-11 16:40:48 -08:00
Keagan McClelland
b298c84d21
fn: introduce option type
...
this commit introduces many of the most common functions you will
want to use with the Option type. Not all of them are used
immediately in this PR.
2023-11-10 13:29:30 -08:00