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

This alias may result confusing to arrow users #1

Closed raulraja closed 4 years ago

raulraja commented 4 years ago

https://github.com/colomboe/KIO/blob/07152d49efedcf0f16d7439e0ad911849dffcd73/src/main/kotlin/it/msec/kio/KIO.kt#L14

We are removing Try in Arrow so this may result confusing to users of Kio or people that use both.

colomboe commented 4 years ago

Yes, I'm aware of the removal, but this data type is comparable with the corresponding data types with the same name already used in the FP world, like the Try type in Scala, or in Java with Vavr.

One of the objective here is to easily introduce people in the FP world, so maybe people coming from Java with Vavr would find something already familiar.

Maybe in Arrow, instead of totally remove it, you could migrate it to the Bifunctor IO that you are going to introduce, using the same <Throwable, A> definition.

raulraja commented 4 years ago

Does it have the same eager semantics as Try in arrow where instantiation causes the effect? If it doesn't this is essentially IO A where Throwable is fixed in terms of Arrow. If this Try is lazy the confusion is that they still would need to perform unsafeRunAsync or similar. We are removing Try because it performs effects eagerly. Most Scala users also expect Try to be eager in effect evaluation so it's never pure.

colomboe commented 4 years ago

This implementation is based on KIO, so it is lazy. You're right about the lazyness semantic difference. Maybe I could adapt in order to use the same ZIO naming convention described here: https://zio.dev/docs/overview/overview_index#type-aliases

raulraja commented 4 years ago

That in my opinion would be better and that is also closer to what Arrow IO is gonna look like since it will have aliases too for the different shapes similar to those so there will be lesser friction from users of both libraries

On Thu, Sep 26, 2019, 10:35 PM Emanuele Colombo notifications@github.com wrote:

This implementation is based on KIO, so it is lazy. You're right about the lazyness semantic difference. Maybe I could adapt in order to use the same ZIO naming convention described here: https://zio.dev/docs/overview/overview_index#type-aliases

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/colomboe/KIO/issues/1?email_source=notifications&email_token=AADPQXHC5IDUZ6ZXS7VALIDQLUMIBA5CNFSM4I26IF22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7W4FXQ#issuecomment-535675614, or mute the thread https://github.com/notifications/unsubscribe-auth/AADPQXDZBGCJSTLBQ2P3OZDQLUMIBANCNFSM4I26IF2Q .

colomboe commented 4 years ago

Typealias naming is now aligned with ZIO.