6 Commits
Author SHA1 Message Date
Gijs van Dam e7b9515edd fn: fix Result[T].FlatMap
For a Result[T], FlatMap should apply f when the result is Ok, and
propagate the error unchanged when it's Err. The original code returns r
on Ok and tries to use r.left when Err, which is wrong. This commit
fixes that.

Secondly, the group of FlatMap/AndThen and OrElse functions and methods
are now properly tested with new unit tests.

fixes #10401
2026-01-06 10:51:49 +01:00
Keagan McClelland 9bbd327a10 fn: add Sink to Result 2024-11-06 16:50:02 -07:00
Keagan McClelland 5dec35426c fn: add transpositions for Option and Result 2024-11-06 16:40:36 -07:00
Keagan McClelland 8971c4c3ae fn: add operations to Result API 2024-11-06 16:40:15 -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