-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scala direct syntax DSL #66
Conversation
@@ -57,8 +57,11 @@ inline fun <A> ai(noinline block: suspend AIScope.() -> A): AI<A> = block | |||
* | |||
* This operator is **terminal** meaning it runs and completes the _chain_ of `AI` actions. | |||
*/ | |||
suspend inline fun <A> AI<A>.getOrElse(crossinline orElse: suspend (AIError) -> A): 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.
We weren't using reified
here.
@OptIn(ExperimentalTime::class) | ||
suspend inline fun <reified A> AI<A>.getOrElse(crossinline orElse: suspend (AIError) -> A): A = | ||
suspend fun <A> AIScope(block: suspend AIScope.() -> A, orElse: suspend (AIError) -> A): 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.
We needed a way to construct AIScope
from Scala, so it cannot be inline. This method allows us to have an convenient entry point from Scala.
@xebia-functional/team-ai This PR is ready for review. I propose we merge this skeleton, so we can continue in parallel on filling in some smaller parts. WDYT? |
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.
Sounds good to me, thanks @nomisRev !
No description provided.