zio / zio-prelude

A lightweight, distinctly Scala take on functional abstractions, with tight ZIO integration

Home Page:https://zio.dev/zio-prelude

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flatmap `>>=` operator

carlos-verdes opened this issue · comments

I could not find support for >>= , it would be great for composition.
Something like:

val transformation: B => F[B] = ???
monad1.flatmap(transformation)

monad1 >>= transformation

Let me link to comment by @adamgfraser
#965 (comment)

Long story short, symbolic methods have a higher cognitive cost that probably isn't worth it here.

I will close the ticket now. As always, we may reconsider adding this in the future.
But thanks for your interest in ZIO Prelude, we hope that you will enjoy it even without >>=.

I started long time back with Scalaz, then found Cats, created my first framework using Free Monads... understood it was quite complex for new people to adopt and understand... then I moved to tagless final and found couple of videos on ZIO.

Right now I'm moving into full ZIO and obviously I missed all the cats functional type classes etc. so I'm giving an opportunity to zio-prelude (for me it has sense to use full set of libraries from the same community).
Honestly speaking what is important is the principles applied on the code not the small details like this (I can always use .flatMap or define myself my own extension method for >>=).

In any case thanks for the effort put creating this library and the prompt response (one of my dreams though would be to have all Scala functional communities united, it will reduce a lot of friction for new people to adopt it).