Commit Graph

6 Commits

Author SHA1 Message Date
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