Hi guys, one question, the typeclass compiler plug...
# arrow-meta
b
Hi guys, one question, the typeclass compiler plugin extension in arrow meta allows me to implement typeclasses like Keep 87 proposes?
s
Similarly to KEEP 87 yes. There are a couple of small differences, for example the call-site syntax currently used in the typeclasses prototype plugin.
Copy code
fun doSomething(TT: Traverse<ForIO> = `with`): IO<Unit> =
  listOf(1, 2, 3).traverse { i ->
    IO.effect { println("Hello $i") }
  }.unit()
💯 1
r
@simon.vergauwen will it change
arrow-kt
syntax? For example now all is wrapped in
Kind<T,V>
type. Will it "unwrap" to
T<V>
?
s
It will allow you to write
T<V>
instead of
Kind<ForT, V>
but it doesn’t require you to do so 🙂
The plugins are opt-in.
What we do with the `Kind`s for example is co-operate with the TypeChecker so that
Kind<ForT, V>
==
T<V>
but the generated code is the same as it is now. We can hide it from the user using a compiler & IDE plugin. So we basically put some syntactic sugar on top of the current impl.
👍 3
b
@simon.vergauwen nice! thank you! Is there any example of an implementation of typeclass?
r
They have the same shape as all typeclasses in arrow but you can check out the compiler plugin tests in meta for an example
👍 2
b
Thank you!
b
It's too bad the syntax couldn't be
implicit TT: Traverse<IO>
😄 🧌