optics-dev / optics-dev/Monocle
Is it possible to make @Lenses ignore some fields?
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.7k
- Forks
- 207
- Avg merge
- 7h 59m
- Merged PRs (30d)
- 5
Description
Suppose I have the following case class (I'm using Scala 2.13):
case class Foo(
a: Int,
b: Int,
...,
z: Int,
noLens: Int
)
Is there any way to use @Lenses to create lenses for all fields except noLens? I tried using private val or multiple parameter lists, but both cases resulted in a compilation error. I know I can manually create all the other lenses, but that's very verbose.
Thanks
Contributor guide
No contributing guide indexed for this repository
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 at the @Lenses annotation implementation for Scala 2.13 and trace how fields in a case class are selected. Review the existing @Lenses behavior and determine whether excluding noLens can be specified without breaking generated lenses; done means a clearly defined, compiling behavior or a documented limitation.
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
- Mostly clear
- Newbie friendliness
- 25/100