I'm looking at this example from attoparsec docs:
simpleComment = string "<!--" *> manyTill anyChar (string "-->")
This will build a [Char]
instead of a ByteString
slice. That's not good with huge comments, right?
The other alternative, takeWhile:
takeWhile :: (Word8 -> Bool) -> Parser ByteString
cannot accept a parser (i.e. cannot match a ByteString
, only a Word8
).
Is there a way to parse chunk of ByteString
with attoparsec that doesn't involve building a [Char]
in the process?