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

Implement filter function for Optional #2588

Closed
wants to merge 5 commits into from

Conversation

lenguyenthanh
Copy link
Contributor

@lenguyenthanh lenguyenthanh commented Dec 5, 2021

The same functionality filer in Monocle Optional.filter

  • Tests
  • More document
  • Update Api description
  • Laws

@lenguyenthanh lenguyenthanh marked this pull request as draft December 5, 2021 09:55
@serras
Copy link
Member

serras commented Dec 20, 2021

Note that in optics libraries in other languages, filtering is usually not part of Optional, but of Fold. See the Haskell version for example. The reason is that the set operation is not so well-defined: can I set a value which does not satisfy the predicate?

@serras serras mentioned this pull request Dec 24, 2021
@serras
Copy link
Member

serras commented Dec 24, 2021

@lenguyenthanh I've turned this PR into a new one introducing OptionalGetter in #2611. Feel free to add your comments there.

@lenguyenthanh
Copy link
Contributor Author

@serras cool, I'll take a look. Should we close this pr now?

@nomisRev
Copy link
Member

nomisRev commented Feb 5, 2022

@lenguyenthanh yes, I'm going to close this PR now. Feel free to re-open if necessary.
Thanks for the work, and the improvement that came from it 🙌

@nomisRev nomisRev closed this Feb 5, 2022
@lenguyenthanh lenguyenthanh deleted the optional-filter branch July 3, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants