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

implemented Flip #184

Closed
wants to merge 2 commits into from
Closed

implemented Flip #184

wants to merge 2 commits into from

Conversation

leandromoh
Copy link

resolved issue #183

@louthy
Copy link
Owner

louthy commented Jan 29, 2017

@leandromoh Hi Leandro, just to let you know that I haven't forgotten about your pull requests. I have a ton of work to do to get the project stable again after moving to VS2017. Once completed, I'll be reviewing your reqs.

@leandromoh
Copy link
Author

@louthy no problem. thanks for the explanation

@louthy
Copy link
Owner

louthy commented Mar 9, 2017

@leandromoh Hi Leandro, I have modified this. In Haskell flip works on two arguments only. There is a clear reason for that which is composition and application. It's less important in C# as I mentioned in the original issue. However I see a value in flipping the first and the last argument. Especially if C# gets the forward pipe operator that is currently a proposal on Rosyln. However beyond 3 arguments I think flipping the first and the last argument feels wrong. So I have modified this to only work on:

    Func<A, Func<B, R>>           ---> Func<B, Func<A, R>>
    Func<A, Func<B, Func<C, R>>>  ---> Func<C, Func<B, Func<A, R>>>

    Func<A, B, R>                 ---> Func<B, A, R>
    Func<A, B, C, R>              ---> Func<C, B, A, R>

There's a nice symmetry with 2 or 3 arguments which doesn't exist with more.

You can find it here

@louthy louthy closed this Mar 9, 2017
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

Successfully merging this pull request may close these issues.

2 participants