The getChunk function returns the rest of the current chunk without consuming it.
Motivation
Often part of the parser is implemented without backtracking, in that case it could be beneficial to implement this particular part in a specialized non-backtracking parser and embed it into the top level backtracking parser. The getChunk allows one to do that.
The scanner package already can embed attoparsec parser into scanner using atto. Now I want to do the opposite thing, namely I want to embed scanner into attoparsec. Here is the prototype.
The
getChunk
function returns the rest of the current chunk without consuming it.Motivation
Often part of the parser is implemented without backtracking, in that case it could be beneficial to implement this particular part in a specialized non-backtracking parser and embed it into the top level backtracking parser. The
getChunk
allows one to do that.The scanner package already can embed attoparsec parser into scanner using atto. Now I want to do the opposite thing, namely I want to embed scanner into attoparsec. Here is the prototype.