colomboe / KIO

A simple, lightweight IO monad implementation for Kotlin with effect rotation
https://colomboe.github.io/KIO/
Apache License 2.0
60 stars 4 forks source link

Integration with ArrowKT #12

Closed Nojipiz closed 11 months ago

Nojipiz commented 11 months ago

I noticed that some features in this library have already been implemented in the ArrowKT core, such as Option , Nullable and most of the non-critical components.

Nowadays, when someone from the functional programming community wants to use Kotlin, they often include ArrowKT as a fundamental library. I believe it would be beneficial to use Arrow's basic classes as the foundation for this library and build upon them.

colomboe commented 11 months ago

When I started working on KIO, some years ago, ArrowKT was still in the 0.x stage, where there was a lot of complexity due to the fake HKT implementation and every release they were changing the library a lot. I wanted to have something simple and with a stable API, so I created KIO.

Today ArrowKT is much better, with a simplified API, much more Kotlin idiomatic. So my suggestion is to move completely to ArrowKT unless you have a good reason to stick on KIO (e.g. ZIO experience).

And if you want to keep both, probably the best way could be to have an "adapting" library outside both KIO and ArrowKT that converts data between the two. Sadly I don't have time right now to work on something like that, feel free to open a PR for something like that.

Nojipiz commented 11 months ago

I agree with you, a good reason to stick with KIO is the ZIO experience. It would be great if i can help with something like that, do you think is a good idea to create that "adapting" inside the KIO library? Or create a external library called zio-arrowkt-adapter?

colomboe commented 11 months ago

I would prefer an external library so we can avoid to have the arrow-kt dependency to maintain in the core KIO library.