-
Notifications
You must be signed in to change notification settings - Fork 73
lastIndexOf' does something odd with indices #55
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
Comments
Apparently that is the intended behavior. From MDN:
So we should probably just document it. |
Or are you referring to the fact that it does not yield exports["_lastIndexOf'"] = function (just) {
return function (nothing) {
return function (x) {
return function (startAt) {
return function (s) {
if (startAt < 0 || startAt > s.length) return nothing;
var i = s.lastIndexOf(x, startAt);
return i === -1 ? nothing : just(i);
};
};
};
};
}; I think this should probably be changed to |
I have looked at this again, and it actually seems fine to me like it is. The index thing I mentioned in the last post still seems weird to me, but it makes sense when looking at the test cases (i.e. if you search for an empty string). In my opinion, this issue can be closed. I have to say, though, that I would be completely fine with removing this function alltogether (same holds for |
The |
Try it here http://sharkdp.github.io/purescript-strings/
The text was updated successfully, but these errors were encountered: