Danilo Herrera
09/16/2019, 7:36 PMKind<F, A>
? For instance, I have a List<Animal>
but want to return Kind<F, Animal>
. Example:
interface AnimalMapper<F> : MonadError<F, Throwable> {
fun Kind<F, FarmDto>.toAnimalsFromNetwork(): Kind<F, Animal> = flatMap { farmDto ->
catch {
farmDto.animalDtos.map {
Animal(
it.id,
it.name
)
}
}
}
}
This yields a type inference error. Expected Kind<F, Animal>
, but found Kind<F, List<Animal>>
kioba
09/16/2019, 8:06 PMListK
with the .k()
ListK is the arrow List implementation and it is a arrow.Kind<ForListK, A>