We are gonna get rid of kapt before 1.0 during thi...
# arrow-contributors
r
We are gonna get rid of kapt before 1.0 during this year but not sure it helps your problem now
g
How do you plan to do that? What about user-defined types with HK?
r
We are gonna rewrite what we have dependent on kapt to be based on the PSI apis
So that codegen works in MPP and I believe we found a way to remove the
stack labels
trick we use reflection for in
binding
and monad comprehensions.
Essentially we discovered that for all suspended data types
bind
or
!
can be expressed in terms of stack safe function application for all capable data types that know how to deal with
suspend
. The current trick https://github.com/arrow-kt/arrow/blob/master/modules/core/arrow-typeclasses/src/main/kotlin/arrow/typeclasses/MonadContinuations.kt#L59-L61 was there to support
Monad
generalized so that
bind
can be expressed delegating to
flatMap
but if if we provide separate continuations for strict vs suspended monads this trick won't be necessary
Kapt and this reflection trick is what currently couples us heavily to just JVM
@gildor if you have any other ideas please share 🙂 we are not married to any particular approach and just wish Arrow to be MPP capable. Many users have asked for this and we think if we change meta to use PSI and rewrite the comprehensions we will get there.
g
Nice plan! What kind PSI do you plan to use?
r
We just got started, @AdrianRaFo is gonna attempt to migrate Arrow meta in this new repo https://github.com/arrow-kt/meta. Essentially it should all work for the most part if we are able to create a meta
Type
instance https://github.com/arrow-kt/arrow/blob/master/modules/meta/arrow-meta/src/main/java/arrow/meta/ast/ast.kt#L233 using the information from PSI. We are not sure how to accomplish that yet.