-
Notifications
You must be signed in to change notification settings - Fork 158
Add elem
combinator to API
#274
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
Conversation
So I'm slightly on the fence about this; for one, elem c = any (==c) and I'm not sure if this meets the https://wiki.haskell.org/Fairbairn_threshold standard. Fwiw, there's appears to be lack of evidence that this is needed insofar as nobody seems to have missed having this trivial definition in However, there's precedent in e.g. Also, in principle, |
My reasoning is precisely that this is a part of the API that's defined for every other string-like object or list-like container. It passes the Fairbarn test on account of it's expected to be there, eminently useful (perhaps less so for text), and it homogenizes the APIs across libraries. You may object to it on the bounds that it's a small addition, but it was surprising that it was not already. |
@hvr updated and it should be ready to go |
@phadej too, if you're more active |
ca402e4
to
378bd74
Compare
@hvr rebased to master so we should be able to just merge with no problems |
This looks good to me (conclusion: we want this for uniformity with other collection-like APIs). Ping @haskell/text for another approval to merge this. |
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.
Adding a test would be nice.
This PR adds the
elem
combinator to the API.