dave08
03/05/2023, 2:56 PMUnresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public open operator fun <A> (EagerEffect<BaseError, TypeVariable(A)> /* = Raise<BaseError>.() → TypeVariable(A) */).invoke(): TypeVariable(A) defined in arrow.core.raise.Raise
public open suspend operator fun <A> (suspend Raise<BaseError>.() → TypeVariable(A)).invoke(): TypeVariable(A) defined in arrow.core.raise.Raise
fun interface RecordConnectionAndGetAccountUseCase {
suspend operator fun Raise<DomainError>.invoke(state: State): Account
}
with(recordConnection) { invoke(state) }
:face_with_spiral_eyes:either { }
everywhere instead...?simon.vergauwen
03/06/2023, 8:16 AMfun interface
there? 🤔
Having two receivers is indeed very annoying, and in case of a method the functions already have a receiver.
Depending on you code usage etc that can be less, or more of a problem. Using Either
doesn't have this issue ye.dave08
03/06/2023, 10:09 AMWhy are you usingBefore I introduced Arrow, it was easier to test interactions between use cases like that 😄... just make a lambda as a Fake... I'd suppose you're proposing to just make that into a top-level function, which would avoid the receiver problem... but then injecting Fakes wouldn't be possible. I guess there isn't any way to have the best of both worlds... avoiding the extra `either`s while not being able to use context receivers to call them in a sane way 😢.therefun interface