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

Contravariant Functor? #149

Closed
rjmk opened this issue Aug 21, 2016 · 3 comments
Closed

Contravariant Functor? #149

rjmk opened this issue Aug 21, 2016 · 3 comments

Comments

@rjmk
Copy link
Contributor

rjmk commented Aug 21, 2016

Copied from fantasyland/static-land#15

Would [fantasyland] be interested in a contravariant functor added to the spec?

It would have a method contramap :: Contravariant f => (a -> b, f b) -> f a. It would become a dependency to profunctor. The laws are pretty much the same as for functor, but with a flip on the functions in composition

Happy to make a PR for [people] to look over

@SimonRichardson
Copy link
Member

👍

On Sun, 21 Aug 2016, 17:28 Rafe, [email protected] wrote:

Copied from fantasyland/static-land#15
fantasyland/static-land#15

Would [fantasyland] be interested in a contravariant functor added to the
spec?

It would have a method contramap :: Contravariant f => (a -> b, f b) -> f
a. It would become a dependency to profunctor. The laws are pretty much the
same as for functor, but with a flip on the functions in composition

Happy to make a PR for [people] to look over


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#149, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ACcaGJ8AEi61MZz5tpaVK21xplNN6bdzks5qiHzLgaJpZM4JpVNo
.

@rpominov
Copy link
Member

rpominov commented Aug 21, 2016

Probably one of reasons why this didn't happen from the beginning is that we didn't want to claim another name for FL in people's methods namespaces. If that was the case, then this is another argument for #146 .

Edit: we had similar issue with almost every algebra: chain/join, ap/lift, traverse/sequence etc. If we won't have to think about cluttering namespaces we can easily have all methods that we find useful. I mean why don't have both chain and join etc.

@SimonRichardson
Copy link
Member

Closing this as the discussions are now in the PR. Reopen if you think otherwise.

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

3 participants