Just starting to learn Kotlin. I'm coming from a F...
# arrow
b
Just starting to learn Kotlin. I'm coming from a FP Scala background, so I'm curious what is usual technology stack that FP-side of Kotlin community uses, i.e. what backend FW, what DB library, do you use coroutines or Futures, etc?
r
Arrow Fx provides what you would find in libs like cats-effect or Zio working over suspend. It’s a safe IO for Kotlin: https://arrow-kt.io/docs/fx/
You can integrate it with Reactor, Rx and others including KotlinX Coroutines
people tend to use Ktor, http4k, spring boot and others in backends
Since by now all integrate with suspend they should work out of the box with Arrow Fx
As for DB libs in backends I’ve seen https://github.com/JetBrains/Exposed in use
b
thank you for your response 🙂 I looked at all libs already, but I'm still trying to understand how Kotlin idiomatic code looks like. For example, I don't understand how coroutines fit in FP space where everything is a value, i.e. can you return such block code from a fuction, like you can when using Future? Also, don't understand is Exposed description of a value like in Slick and if returned value is wrapped in async code (like in Slick with Future). Also, just curious - is there any chance Arrow IO will become bi- or tri-functor like ZIO? (sorry for too many questions 🙂 )
r
IO is IO<E, A> in the upcoming 0.11
I doubt it will ever be like ZIO because in Kotlin extension functions and what we have in Meta gives you auto syntax for type classes and dependencies
I recommend you read through the Arrow Fx,
suspend
in Kotlin removes the need for most IO wrapping as you are used to in Scala
These two functions are equivalent
b
will do, thank you again 🙂
r
Copy code
suspend fun foo(): Unit
def foo(): IO[Unit]
no problem, any time, feel free to ask any question in the channel through your journey 🙂
👍 2
p
there’s #practical-functional-programming too!
👍🏾 1