Add elem combinator to API - #274
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. |
Bodigrim
left a comment
There was a problem hiding this comment.
Adding a test would be nice.
This PR adds the
elemcombinator to the API.