optics-dev / optics-dev/Monocle
[Focus] Non-case class getters
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.7k
- Forks
- 207
- Avg merge
- 7h 59m
- Merged PRs (30d)
- 5
Description
There's no reason not to allow plain old getter methods on non-case classes, generating a Getter. This is something that a user might reasonably guess is supported, and it seems unreasonably to make them bust out the Optics Family documentation to do it.
eg Focus[String](_.length) // Getter[String,Int]
Original issue: https://github.com/optics-dev/Monocly/issues/39
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 by tracing the Focus API and how it handles the shown getter expression on case classes. Check how a non-case class expression such as FocusString is processed, then verify that it produces a Getter[String,Int] without requiring the Optics Family documentation path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100