-
Notifications
You must be signed in to change notification settings - Fork 90
Add generalized flip
#83
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
The name of this function along with its operator alias can change. I don't know a better name for either and have no strong feelings.
Wow cool! instance ff :: Functor (a -> _)
flip :: ∀ a b c . (a -> (b -> c)) -> b -> (a -> c)
flip' :: ∀ b c f . Functor f => f (b -> c) -> b -> f c
flip' :: ∀ a b c . Functor (a -> _) => a -> (b -> c) -> b -> (a -> c) Do we need to keep the specialized version? Does it need an operator? |
Yes, we should keep the specialized (optimized) version, I think. |
That's going down the Haskell |
Don't let the name Call it some other name if that makes it easier to deal with. Again, I don't care the name, so use what you like best.
wat? |
"There is more than one way to do it". |
Excellent points. I still think it'd be better to address the user facing issue of specializing implementations than keep renaming things.
(Perl) cf. |
This doesn't bother me so much. |
What's the verdict here? |
Sounds like it just needs a name. I'd like any function to be able to be specialized but it's mostly unrelated. |
|
|
^ in all seriousness I do actually like
|
It comes up in Hayoo but no solid convention. |
|
To me, one of the most useful places for this function is alongside So I suggest it should be called |
|
One that comes to mind is
😉 |
So, we're at |
Sounds good, thanks! Do the precedence levels work out so that this can be used with |
Do you have an example of how you'd like it to parse? |
Perhaps it should be a test case? |
Something like |
If the operator can be made to work like that, I think it would be nice to put something about it in the comment as well. |
The new precedence lets the operator play nicely with others.
Updated. Didn't add a test since there's no precedent for what a ps test looks like here. |
Thanks, and sorry this took such a long time to merge! |
No worries. Thanks for merging! |
Closes #82
The name of this function along with its operator alias can change.
I don't know a better name for either and have no strong feelings.