typelevel / typelevel/cats

Implicit `catsKernelOrderingForOrder` is not very useful

Open
#4,332 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
5.5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
5

Description

https://github.com/typelevel/cats/blob/21033a6428f0815d046979975f150455691b0b22/kernel/src/main/scala/cats/kernel/Order.scala#L136-L145

The problem is, when the compiler searches for an implicit Ordering[A], it has no reason to check the Order companion object. So it would have to be manually brought into scope e.g. import cats.kernel.Order._ or something.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading kernel/src/main/scala/cats/kernel/Order.scala at lines 136-145 and review the issue discussion about implicit lookup and companion-object scope. Determine the intended way for Ordering[A] to discover cats.kernel.Order, then verify that the resulting behavior no longer requires manually importing Order._.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.