Have you used the library Kategory before?
Functional Programming in Kotlin with Kategory
Kategory is a library that started as a port of Typelevel Scala cats for the Kotlin Programming Language and is now evolving to bring the best of typed FP to Kotlin. This talk will cover some of the main datatypes and abstractions that make typed Functional Programming in Kotlin Possible. Kategory features techniques such as monadic comprehensions, laws, cartesian builders, emulated higher kinds, free monads, and global typeclass instances for the increasingly popular Kotlin programming language.
Raul and Paco will discuss some pragmatic applications of Kategory and some of the different styles you can adopt when working with typed FP in Kotlin including transformers, tagless final, and free algebras.