optics-dev / optics-dev/Monocle

Lens macro-generated for a specific field should allow introspecting the name

Open
#1,363 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Scala
Stars
1.7k
Forks
207
Avg merge
7h 59m
Merged PRs (30d)
5

Description

For instance, given

case class Person(age: Int)

val personAge = GenLens[Person](_.age)

It would be useful to be able to do personAge.name and get back "age". There are a number of use cases for this.

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.

Research direction

Start by tracing the GenLensPerson macro entry point and how the generated lens represents the selected field. Determine how a name such as "age" could be exposed through the lens API, then add coverage for personAge.name returning "age" and verify existing lens behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.