optics-dev / optics-dev/Monocle

[Focus] zoom into a common field of an enumeration

Open
#1,033 4 comments 5 reactions 1 assignee View on GitHub

@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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.