-
Notifications
You must be signed in to change notification settings - Fork 20
Implement bifunctor #34
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
Conversation
|
Merge this before or after #20? |
|
this looks really neat :) |
e92261d to
04d16fd
Compare
|
Hmmm, so I think this is actually backwards. Currently, bimap is implemented like That raises an interesting potential disparity: We have to choose whether the argument ordering of bimap should be more like bimap for an Either, or should be more like then. I'm inclined to go with Either's argument ordering since bimap is following Fantasy-Land, and then is following ES. |
|
As another data point, Fluture uses the Either argument ordering. |
|
LOL, and funnily enough, I wrote the bimap docs to use Either-ordering, even though the code used then-ordering. Ok, I'm convinced ... going with Either-ordering. |
|
At the expense of everyone's confusion, we also could do the same thing as for |
|
me personally if i see Again these are just my personal takes on the subject. However I think we can all agree that promises are just async |
It's certainly worth considering. My thinking right now is that, since we don't have a backward compatibility problem in this case, I prefer calling Maybe that lack of clarity is a reason just to pick something and do it, calling it v1.1.0, seeing how people react, and adjusting course for v2.0.0 as necessary.
Yeah, I agree this is the essence of the problem. People who have learned about ES or A+ promises first will know
That's pretty compelling, imho. Another potential course is simply not to provide |
|
The major use case I can see for Calling |
|
How about this: let's decouple the decision of how to expose error mapping functionality from the decision to add FL 2.0 bifunctor. That means merging #86 first, then rebasing this PR and changing it to provide only the namespaced bimap. Then, we can continue to discuss the best first-class API(s) for bimap, mapError, etc. |
9dad512 to
ec0164d
Compare
|
Finally unwinding the PR stack and getting back to this. Just rebased, and will prune this back to just implementing the fantasy-land namespaced bimap shortly. |
They aren't exactly equivalent: if I'm not sure if or how that helps us in making a decision about |
|
Ok, 67c072a includes only a FL 2.0 namespaced bimap. The travis build fails because of jsinspect, annoyingly. If I bump up the threshold by 1 to 36, it passes :/ My mood right now on |
67c072a to
ec0164d
Compare
ec0164d to
216fa42
Compare
Here's a first go. There are several ways to do it. As two examples, we could:
I went with 2 initially, but definitely open to discussion.
Todo
Close #33