Closed reuleaux closed 5 years ago
This comes down to whether startswith
and endswith
are intended to be used in prefix or infix position. And I can see arguments for both; but then again, we already have the infix versions in Data.List
; so I think it provides more value to keep startswith
or endswith
with the current argument order, as it allows you to write something like
filter (startswith "ba") ["apple","banana"]
So I don't see a compelling enough argument to justify changing the status-quo as well as incur code-breakages which would be hard to detect as the code would still compile without any warning if we swapped the argument order but would behave incorrectly.
I like
MissingH
'sData.String.Utils
module, but never usestartswith
, even though I would like to, and I think it's a good function name.That's because I like my functions to make sense when read out loud:
makes sense to me, because "ba" is a prefix of "banana". However
I find odd, because "ba" does not start with "banana", it's the other way araound: "banana" starts with "ba". thus what I`m doing is this:
I think this should be fixed in MissingH in the long run (and I m sure this would break existing code).