<@UBD6YCVAR> if KEEP-87 is introduced in Kotlin yo...
# arrow
r
@Leandro Borges Ferreira if KEEP-87 is introduced in Kotlin you can then have global package level functions that would look like this:
Copy code
fun <F, A, B> Kind<F, A>.map(f: (A) -> B, with F: Functor<F>): Kind<F, B> =
  map(f)

value.map { it + 1 }
In regard to
Set
. Set should not
map
and get back a Set because it can’t form a lawful
Functor
instance since it can’t guarantee order. More info here https://gist.github.com/tpolecat/7401433#file-gistfile1-scala What we can do though is work on the
SortedSetK
instances that are currently missing and that are similar to the ones we have for
SortedMapK
where you can have a functor instance and provide a proper
map
.