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

Optics #602

Merged
merged 4 commits into from
May 30, 2024
Merged

Optics #602

merged 4 commits into from
May 30, 2024

Conversation

rpiaggio
Copy link
Collaborator

No description provided.

@mergify mergify bot added the model label May 30, 2024
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] =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these have tests?

Copy link
Collaborator Author

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])
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Collaborator

@cquiroz cquiroz left a 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

@rpiaggio rpiaggio marked this pull request as ready for review May 30, 2024 14:41
@rpiaggio rpiaggio merged commit d0ac6bd into master May 30, 2024
18 checks passed
@rpiaggio rpiaggio deleted the input-lenses branch May 30, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants