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 instance for scala.math.Ordering #1853

Closed
durban opened this issue Aug 25, 2017 · 7 comments
Closed

Contravariant functor instance for scala.math.Ordering #1853

durban opened this issue Aug 25, 2017 · 7 comments
Assignees

Comments

@durban
Copy link
Contributor

durban commented Aug 25, 2017

There doesn't seem to be a Contravariant instance for scala.math.Ordering.

@LukaJCB
Copy link
Member

LukaJCB commented Aug 25, 2017

There are some for cats.kernel.Order though. You can use fromOrdering to get an Order from Ordering :)

@durban
Copy link
Contributor Author

durban commented Aug 26, 2017

Sure, but that doesn't really help me if I've got an Ordering[A], and I want to simply contramap to get an Ordering[B]. (Although for that to work, #1850 also need be fixed.)

@kailuowang
Copy link
Contributor

@durban can you elaborate why #1850 is related?

@johnynek
Copy link
Contributor

johnynek commented Aug 30, 2017

@durban you can call .on to go from Order[A] to Order[B] but I agree there should be an instance.

https://github.com/typelevel/cats/blob/master/kernel/src/main/scala/cats/kernel/Order.scala#L53

@non
Copy link
Contributor

non commented Aug 31, 2017

I'm opening a PR that addresses this lack (as well as PartialOrdering, Equiv, and Duration which I also noticed were missing).

@non
Copy link
Contributor

non commented Aug 31, 2017

#1878

@durban
Copy link
Contributor Author

durban commented Aug 31, 2017

@kailuowang I was mistaken, it's not.

@non non closed this as completed in #1878 Sep 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants