Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Either concrete non-suspend fx #124

Merged
merged 12 commits into from
May 29, 2020
Merged

Either concrete non-suspend fx #124

merged 12 commits into from
May 29, 2020

Conversation

nomisRev
Copy link
Member

This is a small PR that implements the same runtime as #112 but in a strict fashion for strict monads that are found in Arrow-Core.

This way they can be implemented without the trick currently used in the FxMonad implementation. This will unbind us from the JVM, and it will remove all penalties paid by the trick.
This can be kept as a MPP implementation in the future as well for people not opting in for the compiler plugin.

Discussion: suspend and non-suspend function have a function name clash. This cannot be solved with @JvmName since Kotlin cannot infer if it needs the suspend or non-suspend.

@nomisRev nomisRev marked this pull request as ready for review May 22, 2020 13:42
@@ -901,6 +900,21 @@ sealed class Either<out A, out B> : EitherOf<A, B> {
} catch (t: Throwable) {
fe(t.nonFatalOrThrow()).left()
}

fun <E, A> fx2(c: suspend EagerBind<EitherPartialOf<E>>.() -> A): Either<E, A> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fxEager? fxNow? fxJust?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to merge as soon as the build is green to continue working with other tickets, so I created an issue to discuss the naming in order not to block us :) Please feel free to continue the discussion there: #133

Copy link
Member

@pakoito pakoito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicit name!

@aballano aballano merged commit 5b8ca8b into master May 29, 2020
@aballano aballano deleted the sv-concrete-fx branch May 29, 2020 14:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants