on master help sign in
Add a review suggestion as comments
85afed5Adithya Kumar
src/Streamly/Internal/Data/Parser/ParserD.hs+8
@@ -851,6 +851,14 @@ takeP lim (Parser pstep pinitial pextract) = Parser step initial extract
851 -- XXX This should error out?
851 -- XXX This should error out?
852 -- If designed properly, this will probably error out.
852 -- If designed properly, this will probably error out.
853 -- "pextract" should error out
853 -- "pextract" should error out
854+ --
855+ -- By Harendra,
856+ --
857+ -- This is a tricky case, we have the following options:
858+ -- 1. Done 0 with extract as you have written
859+ -- 2. Done n, will require buffering elements
860+ -- 3. Use a backtracking fold and not a parser, once we have
861+ -- backtracking in folds
854 else Done 0 <$> pextract s
862 else Done 0 <$> pextract s
855 Partial n s -> do
863 Partial n s -> do
856 let taken = cnt1 - n
864 let taken = cnt1 - n