haskell / attoparsec

A fast Haskell library for parsing ByteStrings
http://hackage.haskell.org/package/attoparsec
Other
512 stars 93 forks source link

Add skipTill? #93

Closed favonia closed 1 year ago

favonia commented 9 years ago

I found the following gadget useful in many of my scripts. It's the "opposite" of manyTill.

skipTill :: Parser a -> Parser b -> Parser b
skipTill junk end = end <|> (junk *> skipTill junk end)

I am wondering if people find this useful too. If so, I'd like to propose adding this one (or an optimized one) to the library.

hadronized commented 9 years ago

Interesting, you should fill in a PR for that! :)

Shou commented 8 years ago

Any progress on this? It'd be a nice, and I think essential, addition to Attoparsec. I remember needing this a few years back and writing it myself so it's nice to see it's getting some traction. I also suggest adding a function that returns both sections in a 2-tuple, named till or something more precise. I'll build on @favonia's PR with that added, I still have the code lying around.

favonia commented 1 year ago

After more then 5 years of inactivity, I can only assume the maintainer is not interested.