-
Notifications
You must be signed in to change notification settings - Fork 185
Replace custom Box and Result with microframeworks #49
Conversation
As it is covered by ??
@@ -151,26 +161,26 @@ class ResultTests: XCTestCase { | |||
XCTAssert(r.isFailure) | |||
XCTAssertEqual(r.error!.domain, "DivisionByZeroError") | |||
} | |||
|
|||
func testRecoverNeeded() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recover functionality is only implemented in antitypical/Result by the ??
operator. It's not possible to add recover as such, but we could just replace recover()
with ??
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking into this as well and I think this is the main difference between BrightFutures' Result and antitypical/Result. We could try to file a PR for antitypical/Result with the recover
and recoverWith
functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to summarize: we’d be happy to accept a PR for recover
/recoverWith
🙇
Thanks for the PR! |
Oops, sorry about that. (The closing and opening.) I'll respond to your comments individually, but I think the way forward is to see if we can get some of the missing features implemented in https://github.com/antitypical/Result and then (either with or without the changes in antitypical/Result) work towards a BrightFutures 2.0 that has this as the main change. I think we can still support 1.x for the time being as well. We might want to consider making |
Please don’t hesitate to let me know if there’s anything |
Sounds great!
I think it would be best to decide now if we want to create |
made `flatMap() -> Future<U>` a free function instead of a instance of `Result`
I've added all discussed changes, so I'm all for merging this PR now |
I have merged this PR into the Thanks again! |
I went ahead and implemented the changes discussed in #48. The basic idea is: replace the
Result
type completely, but keep as much of the old functionality as possible.Because of framework limitations, it's not possible to publicly extend
Result
once it is in a library. Luckily the majority of the functionality is implemented by antitypical/Result as well.All tests succeed, but I disabled a few, I will comment om them individually.