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

is should not require a prism — a fold should be fine. #1063

Open
kindaro opened this issue Mar 28, 2024 · 2 comments
Open

is should not require a prism — a fold should be fine. #1063

kindaro opened this issue Mar 28, 2024 · 2 comments

Comments

@kindaro
Copy link

kindaro commented Mar 28, 2024

This is the function in question. It has type signature is :: APrism s t a b -> s -> Bool. It seems to me that fmap isJust . preview would do the same but have a more general type MonadReader s m => Getting (First a) s a -> m (Maybe a). Can we have this definition for is?

@phadej
Copy link
Collaborator

phadej commented Mar 28, 2024

There is has :: Getting Any s a -> s -> Bool

@kindaro
Copy link
Author

kindaro commented Mar 28, 2024

Alright, so why is is not has? Do they agree on the optics for which both are defined? Can we document this?

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

No branches or pull requests

2 participants