Arrow: ["Request"] Companion unit objects

Created on 2 May 2020  路  2Comments  路  Source: arrow-kt/arrow

What version are you currently using? 0.11.0-SNAPSHOT
What would you like to see?
Hi, in my work, we are using Scala + Cats and for many types, we have very useful.unit extension function. What would you say about adding them to arrow as companion functions?
(I can do this 馃槈)

I mean to add:

val IO.Companion.unit = IO.just(Unit)
val Either.Companion.unit = Either.right(Unit)

Probably the same will be for:
1) MonoK & FluxK
2) ObservableK & SingleK & other rx-java wrappers
3) Any other?
4) Try? (I know it is deprecated, so question mark)

Most helpful comment

For record:
Thank you
I didn't forgot about this, only other PR https://github.com/arrow-kt/arrow-integrations/pull/28 is more important for me at the moment. I will do this after ;)

All 2 comments

If you're up for it then we should add it to Either and Reactor/RxJava and we should also replace the current just(Unit) usages for the new cached value as well as the unit() function in Applicative.

IO already has IO.unit & we shouldn't do it forTry since it should be removed in 0.11.0.

For record:
Thank you
I didn't forgot about this, only other PR https://github.com/arrow-kt/arrow-integrations/pull/28 is more important for me at the moment. I will do this after ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raulraja picture raulraja  路  4Comments

pakoito picture pakoito  路  4Comments

ovu picture ovu  路  4Comments

pakoito picture pakoito  路  3Comments

pakoito picture pakoito  路  4Comments