Add IO#redeem and IO#redeemWith#191
Conversation
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
==========================================
+ Coverage 89.63% 89.69% +0.05%
==========================================
Files 50 50
Lines 1081 1087 +6
Branches 82 77 -5
==========================================
+ Hits 969 975 +6
Misses 112 112 |
LukaJCB
left a comment
There was a problem hiding this comment.
Looks good to me! Sounds pretty useful in general :)
|
Actually I want to think about this some more, so I'm closing it to prevent accidental merging. Will reopen if the case. |
|
OK, thought about it 🙂 As mentioned in typelevel/cats#2237:
Unfortunately for abstracting over it we'll have to wait for Cats 2.0 I think. |
|
Got verbal confirmation that @LukaJCB and @kailuowang are interested in approving the related PR in Cats. I think it's safe to move forward with it and merge this. |
|
Sounds good to me! Though Travis is failing with a syntax error :) |
|
Broken merge with |
This is related to typelevel/cats#2237
This uses
IO's internals to expose an optimizedredeemWithoperation, that's equivalent with doingattempt.flatMap, but avoiding a secondflatMapboundary, or extra boxing inEither.The performance improvements on doing this are pretty good, see: typelevel/cats#2161 — and the capability of doing this has been in
IOever since I optimized its internal encoding, we just need to expose it.