hi folks, I am relatively new to Kotlin and very n...
# arrow
j
hi folks, I am relatively new to Kotlin and very new to functional programming... as a learning exercise I am trying to convert a scala parser library to Kotlin and I was wondering if there is anyway to do this with Kotlin/Arrow: sealed trait FooBar[L <: HList, T <: HList, R <: HList] { type Out <: HList } object FooBar { implicit def foobar[L <: HList, T <: HList, R <: HList, Out0 <: HList] (implicit ts: Aux[L, L, T, T, R, HNil, Out0]): FooBar[L, T, R] { type Out = Out0 } = throw IllegalStateException("Compile-time only call") I am having trouble with the "type" parameter which is reassigned with the function "foobar" (ie. fb.Out can be assigned a different type)...
r
@Jeff Thomas we are still in the early stages of
arrow-generic
which eventually it will provide type class derivation for any type classes that already target a product type such as HList or Tuple* but it's not there yet. At the moment you can just derive the ones shown here http://arrow-kt.io/docs/generic/product/
Also Kotlin has no notion of abstract path dependent types like the
type Out
so that would look different once we have an strategy for it.
j
ok thanks Raul ... will keep checking back for new developments 🙂