CLOVIS
06/18/2024, 7:02 PMPiotr KrzemiÅski
06/19/2024, 6:02 AMCLOVIS
06/19/2024, 6:40 AMPiotr KrzemiÅski
06/19/2024, 6:42 AMSergey Aldoukhov
06/19/2024, 6:01 PMCLOVIS
06/19/2024, 6:02 PMSergey Aldoukhov
06/19/2024, 6:04 PMsuspend inline fun <reified Out : Any> SpineResponse<Out>.body(raiseIn: Raise<HttpResponse>): Out =
bodyOrNull() ?: raiseIn.raise(httpResponse)
CLOVIS
06/19/2024, 6:07 PMRaise
type comes from Ktor and is a direct consequence of the way Ktor endpoints are defined, though. The complexity here has nothing to do with Arrow.CLOVIS
06/19/2024, 6:08 PMpublic inline fun <reified R : Any> Route.put(
path: String,
crossinline body: suspend PipelineContext<Unit, ApplicationCall>.(R) -> Unit
): Route = put(path) {
body(call.receive())
}
Based on the fact that my target audience is Ktor users, and they clearly are not bothered by this, then no, I don't think 90% of my target audience will be confused š
If anything, Spine's version is simpler than the official one š
CLOVIS
06/19/2024, 6:10 PMSergey Aldoukhov
06/19/2024, 6:17 PMCLOVIS
06/19/2024, 6:18 PMSergey Aldoukhov
06/19/2024, 6:19 PMSergey Aldoukhov
06/19/2024, 6:21 PMSergey Aldoukhov
06/19/2024, 6:22 PMCLOVIS
06/19/2024, 6:23 PMSergey Aldoukhov
06/19/2024, 6:24 PMSergey Aldoukhov
06/19/2024, 6:26 PMCLOVIS
06/19/2024, 6:27 PMPipelineContext<Unit, ApplicationCall>
. Do you even know what that Unit
type parameter does? 'cause I have no idea, and it has never made me say Ktor is unreadable.CLOVIS
06/19/2024, 6:28 PMOtherwise, looks goodWelcome to Arrow! You understood what it does without needing to look at the documentation. Please do look at it one of these days, you may find that you enjoy it.
Sergey Aldoukhov
06/19/2024, 6:29 PMSergey Aldoukhov
06/19/2024, 6:29 PMCLOVIS
06/20/2024, 10:41 AM