Cats Effect 1.0.0-RC#659
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #659 +/- ##
==========================================
- Coverage 91.03% 90.87% -0.17%
==========================================
Files 377 377
Lines 10032 10089 +57
Branches 1887 1900 +13
==========================================
+ Hits 9133 9168 +35
- Misses 899 921 +22 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Updates Monix to Cats-Effect 1.0.0-RC.
I managed to produce another gigantic PR, not sure how I do it 🙂 but many changes are superficial...
Platform.composeErrorsfor those cases in which, given multiple exceptions, we need to combine and signal multiple errors somehow — the logic is platform independent, as on top of the JVM we're usingThrowable#addSuppressed, but on top of JavaScript we're simply returning aCompositeExceptionStackFrameto no longer take anUncaughtExceptionHandleron error; this is a change to the internals of bothTaskandCoeval, as instead of reporting the error using a provided logger, we're now composing errors usingPlatform.composeErrorsbracketandbracketCaseforCoeval,TaskandIterantTasknow also implements the newAsync#never; this posed difficulty in testing the new law, due to having to test for non-termination, which doesn't work well when we are testingTask#unsafeRunSync, so for those particular tests we're disabling the laws that test for non-terminationCoevalI added parens to.runTry()and.run()to signal side effects, which is a generally agreed upon convention in Scala; this doesn't have an impact on binary or source compatibility, other than warnings; many of the files enumerated as changed are due to thisredeemandredeemWithforTaskandCoeval, as optimizations forattempt.mapandattempt.flatMaprespectively; see related issues: Add error-handling methods toEitherTtypelevel/cats#2237 and Add IO#redeem and IO#redeemWith typelevel/cats-effect#191Iterantdeprecated the oldIterant.bracket, replacing it withIterant.resourceIterant.resourcerelying onflatMapforusehighlighted problems inIterant#flatMapthat were fixedIterant#bracketandIterant.resourceare now implemented in terms of a newdoOnExitCaseoperator; and the now deprecatedIterant.bracketis implemented in terms ofIterant.resourceandflatMapIterant.emptynow returns the same reference, optimizing memory usageIterant#dumpwas made more useful by printing the type of the node at each step ... this happened due to me debuggingIterant.resource(acquire)(release).flatMap(use), which was pretty hardIterant#doOnFinishis now gone, now being derived fromdoOnExitCaseSo the new
doOnExitCaseforIterantlooks like this:And then we can describe
Iterant.resource:The deprecated
Iterant.bracket:And the new
Bracketimplementation:Things left to do, but not addressed in this PR:
Observable#doOnExitCaseObservable.resourceIterant#cancelableas a way to address cancelation inF[_], see Cancelation laws presuppose no interruption typelevel/cats-effect#192 (comment)Taskviolates theConcurrentandConcurrentEffectlaws when it is executed with the auto-cancelable run loop active and that's a big problemTask#bracketis broken in the presence of auto-cancelable run loops