Skip to content

created examples for String functions and refactored existing ones #90

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

Merged
merged 4 commits into from
Dec 16, 2017

Conversation

csicar
Copy link
Contributor

@csicar csicar commented Dec 16, 2017

No description provided.

Copy link
Contributor

@hdgarrood hdgarrood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a couple of minor suggestions.

-- |
-- | ```purescript
-- | lastIndexOf' (Pattern "c") 2 "abcdc" == Just 2
-- | lastIndexOf' (Pattern "c") 3 "abcdc" == Just 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it would be better to choose indices which change the result, so that it's a little clearer what's going on? E.g.

lastIndexOf' (Pattern "a") 1 "ababa" == Just 0
lastIndexOf' (Pattern "a") 2 "ababa" == Just 2
lastIndexOf' (Pattern "a") 4 "ababa" == Just 4

At the same time, could you please update the comment so that it says "starting at the specified index and searching backwards towards the beginning of the string"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behaviour confused me at first; see #91 for some context.

@hdgarrood
Copy link
Contributor

We'll also want to update Data.String.CodePoints with similar examples but that doesn't need to happen right now.

@hdgarrood hdgarrood merged commit b3485f6 into purescript:master Dec 16, 2017
@hdgarrood
Copy link
Contributor

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants