-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
@@ -1065,7 +1187,7 @@ fun <E, A, B, E2 : E> IOOf<E, A>.flatMap(f: (A) -> IOOf<E2, B>): IO<E2, B> = | |||
* } | |||
* ``` | |||
*/ | |||
fun <E, A> IO<E, EitherOf<E, A>>.flattenEither(): IO<E, A> = | |||
fun <E : Throwable, A> IO<EitherOf<E, A>>.flattenEither(): IO<A> = |
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.
👀 @nomisRev @JorgeCastilloPrz Although not as useful as before, I left this functions here but restraining E to throwable, so they can still be used in certain situations
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.
Nice work! 👏 👏 👏
There is some regression in this PR we should solve before merging.
val disposable = fix().unsafeRunAsyncCancellable { either -> | ||
either.fold(cont::resumeWithException) { cont.resume(it) } | ||
val disposable = fix().unsafeRunAsyncCancellable { result -> | ||
result.fold<Unit>(cont::resumeWithException, cont::resume) |
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.
If you specify Unit
for fold
does it allow you to use cont::resume
and otherwise it doesn't? :O
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.
No idea, just removed the explicit type to see if it compiles
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.
And it doesn't, need to add it explicitely 😂
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.
Cool. Didn't know you could fix bypassing <Unit>
to fold
.
I've always made anonymous lamdas
arrow-fx-rx2/src/main/kotlin/arrow/fx/rx2/FlowableKConnection.kt
Outdated
Show resolved
Hide resolved
arrow-fx-rx2/src/main/kotlin/arrow/fx/rx2/ObservableKConnection.kt
Outdated
Show resolved
Hide resolved
IO.Bind(IO.ContextSwitch(applyRelease(ExitCase2.Exception(e)), IO.ContextSwitch.makeUncancellable, disableUncancellableAndPop), | ||
ReleaseRecoverException(e)) | ||
override fun recover(e: Throwable): IO<B> = | ||
IO.Bind( |
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.
@nomisRev I brought back this as well FYI
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.
👌
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.
Awesome work!! Looks great! 👏 👏 👏
It's not in the diff, but one more class can be removed. 🎉
class UnhandledError(val error: Any?) : Throwable(message = "Encountered UnhandledError during cancellation: $error") {
This reverts commit 0d7c9c2.
Fixes #175