Kev
09/01/2022, 7:50 AMEither.resolve
extension function that is commented as “resolving some suspended function” however, the function parameter is not of a suspended type. Would this be a problem with the docs, the implementation or my understanding?
https://github.com/arrow-kt/arrow/blob/main/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt#L1175-L1199Emil Kantis
09/01/2022, 8:00 AMKev
09/01/2022, 8:02 AMf
parameter?Emil Kantis
09/01/2022, 8:35 AMEmil Kantis
09/01/2022, 8:36 AMf
isn't suspend () -> Either<E, A>
, instead of () -> Either<E, A>
?Kev
09/01/2022, 9:45 AMphldavies
09/01/2022, 9:58 AMf
is directly called within the same scope - if it contains suspending calls then they would fall under the same constraints as if you’d written them directly in the call-site rather than in the lambda. As such, the call-site would have to be suspending if the block contained suspending calls.