Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CartesianBuilder's .map is slightly irritating #1260

Closed
tpolecat opened this issue Aug 2, 2016 · 4 comments
Closed

CartesianBuilder's .map is slightly irritating #1260

tpolecat opened this issue Aug 2, 2016 · 4 comments

Comments

@tpolecat
Copy link
Member

tpolecat commented Aug 2, 2016

So, when we copied scalaz's ApplicativeBuilder syntax (a |@| b |@| ...)(f) we changed the final .apply to .map which is an innocent but perhaps unhelpful change. My particular issue is that I'm trying to maintain code that needs to compile with both cats and scalaz; most code works fine just by changing/renaming imports, but this syntactic difference requires additional machinery.

Right now @rossabaker and I are probably the only people hitting these things head-on right now, but I imagine there will be more people porting code at some point and it would be nice to not make things harder unless there's a good reason.

So … might we consider allowing both .apply and .map here?

@rossabaker
Copy link
Member

I'm currently experimenting with syntax to smooth the transition from scalaz to cats. (Somehow I missed CartesianBuilder thus far!). I've wondered about spinning this off as a library, with everything deprecated, so that s/import scalaz/import cats holds the developer's hand through finding the right cats calls. We could even go so far as to put them in cats for a more out-of-box migration assistant, though it does suck to approach a 1.0 with deprecated baggage.

@kailuowang
Copy link
Contributor

kailuowang commented Aug 3, 2016

Just want to link PR #1112 here since it proposes to rid of the |@| syntax.
Personally I have no problem with the |@| and I am okay with both apply and map

@julienrf
Copy link
Contributor

julienrf commented Aug 3, 2016

Since the applicative builders work with applicative functors as well as with applicative contravariant and invariant functors, I don’t think it is a good idea to make .apply a shorthand for .map. The name .map, .contramap, etc. makes it clearer what the intention of the user is.

@tpolecat
Copy link
Member Author

tpolecat commented Aug 3, 2016

@julienrf ah ok, I didn't know there were other operations. That makes sense. Ok, I'm convinced.

@tpolecat tpolecat closed this as completed Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants