I'm trying to get familiar with the arrow-kt library, but I'm to dumb to get the easiest thing done: Using one of the built in type classes, namely 'Show' I tried it with kapt using the @extension annotation and kapt itself is generating the necessary code as expected, but the reference to the extension function 'show(): String' is missing. Could somebody please help me with this problem? I wasted two days getting this to work.
Thank you very much!
Best regards
Alex
The class to be extended:
package org.hudelundpfusch.sqwakkel.arrowtest
import arrow.extension
import arrow.typeclasses.Show
class Fump(private val fumpel: String) {
companion object {}
override fun toString(): String {
return "Fump(fumpel='$fumpel')"
}
}
@extension
interface FumpShow
: Show<Fump> {
override fun Fump.show(): String = toString()
}
Here I wanted to use the extension function:
package org.hudelundpfusch.sqwakkel.arrowtest
class Gump {
private val fump: Fump = Fump("Fumpel!")
fun gumpel(): String = fump.show()
}
But the reference to 'fump.show()' is missing =(