This repository has been archived by the owner on Aug 29, 2022. It is now read-only.
Align Task and Task.Result with Swift 5 Result #274
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's in this pull request?
Completes #271.
Either.Left
is no longer an associated type. Post-Swift 5, we can add the associated type but not change one, so we leave it as an alias forError
.Task.Result.extract()
becomesget()
.Task.Result.withValues(ifLeft:ifRight:)
is removed in favor ofget()
.Task.Result.init(from:)
becomesTask.Result.init(catching:)
.Task.Result.map(_:)
andTask.Result.flatMap(_:)
no longer do any magic aroundthrows
.Task.Result.mapError(_:)
andTask.Result.flatMapError(_:)
.Task<SuccessValue>
becomesTask<Success>
, includingTask.Result
.Testing
Improves coverage of
TaskResult
and combines together its scattered sources of testing.API Changes
Yes, it does. Details above. Here, we're supporting upgrading from Deferred 3 with
@availability
, but not previous betas (sorry).The intent here is that, although we plan to release Deferred 4 soon, we want to ease pain for upgrading to both it and the upcoming Swift 5.