Closed massimiliano-mantione closed 4 years ago
On similar "functional programming adaptation projects" I have seen Option types where the None branch actually carries a value and is used to describe errors.
Option
None
An example is fp-ts for Typescript.
This is exactly what the Rust Result type does, so I added support for it handling it just like Option.
Result
This can be useful to chain computations on the "happy path", like when chaining and_then calls.
and_then
amazing!! thanks for this! i will review it tonight
Looks fine to me!
On similar "functional programming adaptation projects" I have seen
Option
types where theNone
branch actually carries a value and is used to describe errors.An example is fp-ts for Typescript.
This is exactly what the Rust
Result
type does, so I added support for it handling it just likeOption
.This can be useful to chain computations on the "happy path", like when chaining
and_then
calls.