Closed nightruby-isa closed 1 year ago
Would love to have FlatMap option on Result.
Mapping with same error type packing them together.
In bigger Pipelines where the Result on a Map returns a Result itself makes it hard to chain together, especially if you are in an async context.
Result<Foo, Error> CreateFoo(Bar b); Result<Bar, Error> CreateBar(); CreateBar().Map(b => CreateFoo(b)) // creates Result<Result<Foo, Error>, Error> CreateBar().FlatMap(b => CreateFoo(b)) // Result<Foo, Error>
AndThen has the behaviour of a FlatMap
Would love to have FlatMap option on Result.
Mapping with same error type packing them together.
In bigger Pipelines where the Result on a Map returns a Result itself makes it hard to chain together, especially if you are in an async context.