Comments (10)
@Equwece you can use https://hackage.haskell.org/package/base-4.18.0.0/docs/Data-Array-Byte.html and low-level operations like https://hackage.haskell.org/package/base-4.18.0.0/docs/GHC-Exts.html#v:readIntArray-35-. You might end up implementing a small module with helper functions similar in spirit to https://hackage.haskell.org/package/text-2.0.2/docs/Data-Text-Array.html.
That said, I'd prototype with array
package. If it works out well, you'll be able to migrate to low-level primitives later.
from bytestring.
Exported isSuffixOf.
We lack implementations of isInfixOf and breakSubstring. We should probably get them from the stringsearch
package.
from bytestring.
The relevant part of stringsearch
: http://hackage.haskell.org/package/stringsearch-0.3.6.6/docs/Data-ByteString-Lazy-Search.html
from bytestring.
What's the blocker here? I've just ran into this.
from bytestring.
@ribosomerocker No blockers, PRs welcome.
from bytestring.
Am I correct in assuming that this depends on #307 ?
This would need to have a breakSubstring implementation used in the lazy substring module. Is it fine to continue with the current implementation?
from bytestring.
Not necessarily: it's likely better to have at least some (non-pathological) breakSubstring
for lazy ByteString
than none at all. Further refinements can be done separately.
from bytestring.
Hi, I am trying to add a lazy variant of breakSubstring
from stringsearch
to solve #100 and need an advice. The code from the stringsearch
actively uses (1, 2) array
package, but this package is not included in bytestring's build dependencies, what can be the preferred way to solve this problem (I suppose that adding new build dependency is not an option)?
from bytestring.
I've been recently hit by the absense of lazy breakSubstring
again.
A lazy way to implement breakSubstring
for lazy ByteString
is to adopt https://github.com/haskell/text/blob/master/src/Data/Text/Internal/Lazy/Search.hs. The algorithm in text
has been well tested and well benchmarked, so it's a safe bet, given that it seems no one has much time to dedicate to this issue. @clyring what do you think?
from bytestring.
Sorry for the lack of progress on the task, I have implemented a lazy variant of breakSubstring
using a self-written BoyerMoore implementation and byte array primitives similar to the text
module (really appreciate @Bodigrim answer), but a quick benchmarking showed that my solution is much slower than stringsearch
's solution, so I decided not to send pr yet and improve the implementation, but unfortunately I haven't found the time yet.
from bytestring.
Related Issues (20)
- bytestring-0.11.5.1 (ghc-9.4.6) fails to build on Fedora HOT 4
- isValidUtf8 is broken HOT 4
- Compatibility with GHC's JavaScript backend HOT 1
- Overhaul Data.ByteString.Builder.RealFloat HOT 5
- Float and Double standard with precision 0 outputs incorrectly HOT 2
- Positive and Negative Zero Print Incorrect Precision
- Guidelines for using with WriterT HOT 2
- RealFloat Zero Padded Exponent HOT 7
- Faster Printing for Known Normal and Subnormal IEEE754 Floating Point Values
- Broken links in haddocks of `ShortByteString` HOT 1
- Audit `foreign import ccall` types
- Drop support for GHCs older than 8.4 HOT 1
- Add a splice of ShortByteString builder
- 0.12.1.0 fails to build on darwin aarch64 with GHC-8.10.7 HOT 13
- Create strict bytestrings from FixedPrim with zero copy HOT 6
- Lazy `zip` is stricter than expected
- unsafeUseAsCString(Len) may return a NULL pointer. HOT 9
- Document that `Data.ByteString.Lazy.appendFile` is not threadsafe.
- Eq and Ord for Builder
- Offer conversion with `Natural`. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bytestring.