Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected optic generation where ambiguity is expected #665

Open
jppellet opened this issue Dec 16, 2016 · 3 comments
Open

Unexpected optic generation where ambiguity is expected #665

jppellet opened this issue Dec 16, 2016 · 3 comments
Labels

Comments

@jppellet
Copy link

Given this context:

sealed trait T
case class A(s: String) extends T
case class B(s: String) extends T

this expression lens[T].s yields a Prism[T, String] that handles A values and ignores B. A GitHub discussion suggested the generation should have failed due to ambiguity instead.

Other idea: that this expression yields a Lens[T, String] that can handle both A and B values :-)

@joroKr21
Copy link
Collaborator

joroKr21 commented Apr 2, 2020

I think instead of ambiguity it would be better if this generates a Lens[T, String]

@joroKr21 joroKr21 added this to the shapeless-2.5.0 milestone Apr 2, 2020
@milessabin
Copy link
Owner

I honestly think it would be better to retire shapeless lenses in favour of Monocle.

@joroKr21
Copy link
Collaborator

joroKr21 commented Apr 2, 2020

I honestly think it would be better to retire shapeless lenses in favour of Monocle.

Fair point although I'm not sure if Monocle offers the same convenience (e.g. Dynamic)

@joroKr21 joroKr21 removed this from the shapeless-2.5.0 milestone Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants