Obtaining typeTag of NonEmptySet
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 5.5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
The following:
import scala.reflect.runtime.universe.typeTag
implicit val tag = typeTag[NonEmptySet[Int]]
gives me:
No TypeTag available for cats.data.NonEmptySet[Int]
Apparently this is some sort of an issue with Scala that's been known for some time that "the case classes must be defined top level - they cannot be nested." and there is no workaround for it.
Why then, are NonEmptySet/Map etc. implemented with newTypes while NonEmptyList has an actual implementation and doesn't have the same problem?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the typeTag[NonEmptySet[Int]] example with Scala reflection and compare it with NonEmptyList, NonEmptyMap, and the related newtype implementations. Determine whether the difference is an implementation limitation or an actionable Cats change; done means a documented rationale or a clearly scoped fix is established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100