typelevel / typelevel/shapeless-3
Support Mirror.Sum for union types
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Scala
- Stars
- 204
- Forks
- 24
- Avg merge
- 4h 5m
- Merged PRs (30d)
- 1
Description
type Color = "Brown" | "White" | "Yellow" | "Black"
given Encoder[Color] = Encoder.derived
inline def derived[T](using gen: K0.Generic[T]): Encoder[T] =
gen.derive(product, coproduct)
[error] 19 | given Encoder[Color] = Encoder.derived
[error] | ^
[error] | no implicit argument of type shapeless3.deriving.K0.Generic[
[error] | (("Brown" : String) | ("White" : String) | ("Yellow" : String) |
[error] | ("Black" : String)
[error] | )
[error] | ] was found for parameter gen of method derived in object Encoder
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
The issue points to Encoder.derived and shapeless3.deriving.K0.Generic; start by tracing how the shown derivation handles coproducts and Scala union types. Done means the Color example compiles with Encoder.derived and the behavior is covered by the project's relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100