optics-dev / optics-dev/Monocle
[Focus] zoom into a common field of an enumeration
Open
@yilinwei is already working on this.
Since Jan 3, 2024.
feature
- Dominant language
- Scala
- Stars
- 1.7k
- Forks
- 207
- Avg merge
- 7h 59m
- Merged PRs (30d)
- 5
Description
sealed trait User {
def id: Long
}
case class Reader(id: Long, isPremium: Boolean) extends User
case class Editor(id: Long, favoriteFont: String) extends User
Focus[User](_.id)
// res: Lens[User, Long]
Original issue: https://github.com/optics-dev/Monocly/issues/14
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.
Assessment
This issue has not been assessed yet.