I wonder why Ior.flatMap need to be passed a Semig...
# arrow
m
I wonder why Ior.flatMap need to be passed a Semigroup<A> and sequence an Applicative<G>. Why isn't it just finding a "typeclass" og that type for A and G? (.semigroup() and .applicative())
s
Kotlin doesn't have the capabilities to find a typeclass, so you need to manually pass it.
👍 1
r
We used to have a runtime map of instances and we pulled them out without arguments by retrieving them from the map using
inline reified A
but when one is not found the only solution was to throw a runtime error so we changed to explicit. In the future if the compiler has a way to support multiple receivers and compiler plugin support in the IDEA plugin some of these APIs may change and in some cases we may able to restore kind polymorphism and automatic-injection
☝️ 1
👍 2
m
Ah ok. I see it is progress in that improvement: https://youtrack.jetbrains.com/issue/KT-10468 🙂