Skip to content
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

Add breakSubstring function to Data.ByteString.Lazy. #129

Closed

Conversation

mrijkeboer
Copy link

This is a copy of the version in Data.ByteString with the following changes:

  • breakByte -> break
  • unsafeDrop -> drop
  • unsafeHead -> head
  • unsafeIndex -> index
  • unsafeSplitAt -> splitAt
  • unsafeTake -> take

This is a copy of the version in Data.ByteString with the following
changes:

- breakByte -> break
- unsafeDrop -> drop
- unsafeHead -> head
- unsafeIndex -> index
- unsafeSplitAt -> splitAt
- unsafeTake -> take
@mrijkeboer
Copy link
Author

mrijkeboer commented Jun 29, 2017

It seems that after my last commit, the continuous integration tests fail on something other than the changes of this pull request.

@SeanRBurton
Copy link
Contributor

It is not reasonable to just port the Data.ByteString implementation; the algorithm there requires constant-time indexing for good performance.

@SeanRBurton
Copy link
Contributor

SeanRBurton commented Jul 18, 2017

Instead of using indexing, you should keep references to the start and end of the span being considered, and iterate them in lock-step using tail (like a zipWith).

Copy link
Member

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

@mrijkeboer Do you intend to address the issues that @SeanRBurton pointed out? Otherwise it might be time to close this PR…

(I'm setting the status to "Changes requested" for clarity)

@mrijkeboer
Copy link
Author

@sjakobi It looks like I won't have time to address @SeanRBurton issues any time soon, so I'll close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants