nothing too long, it’d be like ```fun (Traverse&l...
# arrow
p
nothing too long, it’d be like
Copy code
fun (Traverse<F>, Applicative<G>, Kind<F, Kind<G, A>>).sequence(): Kind<G, Kind<F, A>> =
  traverse(::it)
c
Wow, that's a mouthful 😅 Do you have a simpler example, like
Option.map
? (even if it doesn't exist anymore, it's just much simpler to think about...)
p
map doesn’t need multiple receivers, that’s the thing
c
Good point 😅
p
Copy code
fun (Functor<F>, Kind<F, A>).map(f: (A) -> B): Kind<F, B> =
  map(f)
but for the sake of it, let’s pretend we’re doing it this way 😄
c
We really need an IDE plugin at some point that displays
Kind<F, Kind<G, A>>
as
F<G<A>>
, it's definitely not beginner-friendly currently
p
Copy code
fun (Applicative<G>, Option<A>).map(f: (A) -> B): G<Option<B>>
something like that
c
From what I can read about typeclasses and multiple receivers, the “ideal Kotlin syntax” would be something like that, right?
Copy code
@with<Functor<F>>
fun F<A>.map(f: (A) -> B): F<B> =
  map(f)
(That example might be useless, I just want to understand how the concepts I'm learning in Category Theory and Type Theory will be used in Kotlin)