Comments (5)
Thanks for filing this!
I’m of two minds. Against:
- I really like reinforcing use of the extant
??
operator—overloading is very much in Swift’s idiom, and the analogy betweenResult
’s??
andOptional
’s is clear, and supportive of general use of the language. Addingrecover
/recoverWith
dilutes that somewhat, and so I’m a bit reluctant.
For:
??
doesn’t coverrecoverWith
, and an??
overload taking a function on the right hand side feels like it’s too distinct in usage from the extant overloads to be reasonably named??
, and I don’t much want to define new custom operators.recover
andrecoverWith
are pretty decent names with some precedent, and names are searchable where operators are not; for which reason (in part) we haveflatMap
as well as>>-
.
On the balance, I think it’d make a fine addition. My only request is that the documentation for recover
mention the equivalence with ??
.
Thank you kindly!
from result.
Fixed by #42. I’ll tag in a moment.
from result.
@robrix Thanks for the fast response & thanks @nvh for the PR 🌟
from result.
🎉 ❤️
from result.
You’re very welcome 😄
from result.
Related Issues (20)
- Support for higher order functions that can throw HOT 1
- Add Result to swift compatibility check HOT 1
- Replace `NoError` with `Never`? HOT 1
- Lower the `Error: Swift.Error` constraint on `Result` temporarily. HOT 4
- Why not declare 'Result' as 'Result<T>'? So it easy to deal with different types of errors. HOT 6
- [Disabled code coverage for xCode 9] HOT 1
- Unable to use the Result namespace HOT 3
- Using `init(attempt:)` always produces `Result` with `AnyError` type HOT 6
- Non-throwing dematerialize for result using NoError HOT 1
- Change (some) flatMap to compactMap? HOT 2
- 4.0 release HOT 1
- Adding a `fold` method HOT 5
- Result vs. Throws README section is out of date HOT 1
- Result initializer works in for loop but not map? HOT 1
- support required for swift 4.2 HOT 2
- How to pass an array of Swift.Errors as the right (Error) type? HOT 3
- Example os import usage for Swift 5/4 HOT 9
- Migration to Swift 4 HOT 1
- Cocoapods instructions still pin to v4 HOT 3
- Swift 5 support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from result.