-
Notifications
You must be signed in to change notification settings - Fork 5
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
Optics #602
Optics #602
Conversation
final def pAssign[A, B]: PPrism[Input[A], Input[B], A, B] = | ||
PPrism[Input[A], Input[B], A, B](_.toOption.map(Right(_)).getOrElse(Left(Ignore)))(Assign.apply) | ||
|
||
final def assign[A]: Prism[Input[A], A] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these have tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that's why it's still a draft.
@@ -12,4 +16,17 @@ package object syntax { | |||
def orIgnore: Input[A] = Input.orIgnore(a) | |||
def orUnassign: Input[A] = Input.orUnassign(a) | |||
} | |||
|
|||
implicit final class LensToLensOps[S, T, A, B](private val lens: PLens[S, T, A, B]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we using this method instead of extension
to remain cross compilable to scala 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks it looks great
No description provided.