@@ -366,7 +366,7 @@ parseChunk
366 -> Array a
366 -> Array a
368 -> m (ChunkResult s b)
368 -> m (ChunkResult s b)
369−parseChunk pstep state (Array contents start end) offset = do
369+parseChunk pstep !state (Array contents start end) !offset = do
370 if offset >= 0
370 if offset >= 0
371 then go SPEC (start + offset * SIZE_OF(a)) state
371 then go SPEC (start + offset * SIZE_OF(a)) state
372 else return $ ChunkContinue offset state
372 else return $ ChunkContinue offset state
@@ -427,7 +427,7 @@ parseDToK
427 -> Input a
427 -> Input a
428 -> (ParseResult b -> Int -> Input a -> m (Step a m r))
428 -> (ParseResult b -> Int -> Input a -> m (Step a m r))
429 -> m (Step a m r)
429 -> m (Step a m r)
430−parseDToK pstep initial extract offset usedCount input cont = do
430+parseDToK pstep initial extract !offset !usedCount !input cont = do
431 res <- initial
431 res <- initial
432 case res of
432 case res of
433 ParserD.IPartial pst -> do
433 ParserD.IPartial pst -> do
@@ -442,7 +442,7 @@ parseDToK pstep initial extract offset usedCount input cont = do
442 -- XXX We can maintain an absolute position instead of relative that will
442 -- XXX We can maintain an absolute position instead of relative that will
443 -- help in reporting of error location in the stream.
443 -- help in reporting of error location in the stream.
444 {-# NOINLINE parseContChunk #-}
444 {-# NOINLINE parseContChunk #-}
445− parseContChunk count off pst arr = do
445+ parseContChunk !count !off !pst !arr = do
446 pRes <- parseChunk pstep pst arr off
446 pRes <- parseChunk pstep pst arr off
447 -- The "n" here is stream position index wrt the array start, and not
447 -- The "n" here is stream position index wrt the array start, and not
448 -- the backtrack count as returned by byte stream parsers.
448 -- the backtrack count as returned by byte stream parsers.
@@ -452,15 +452,15 @@ parseDToK pstep initial extract offset usedCount input cont = do
452 (cont (Success n b) (count + n - off) (Chunk arr))
452 (cont (Success n b) (count + n - off) (Chunk arr))
453 ChunkPartial n pst1 ->
453 ChunkPartial n pst1 ->
454 assert (n < 0 || n >= Array.length arr)
454 assert (n < 0 || n >= Array.length arr)
455− (return $ Partial n (parseCont (count + n - off) pst1))
455+ (return $ Partial n (parseCont SPEC (count + n - off) pst1))
456 ChunkContinue n pst1 ->
456 ChunkContinue n pst1 ->
457 assert (n < 0 || n >= Array.length arr)
457 assert (n < 0 || n >= Array.length arr)
458− (return $ Continue n (parseCont (count + n - off) pst1))
458+ (return $ Continue n (parseCont SPEC (count + n - off) pst1))
459 ChunkError n err ->
459 ChunkError n err ->
460 cont (Failure n err) (count + n - off) (Chunk arr)
460 cont (Failure n err) (count + n - off) (Chunk arr)
462 {-# NOINLINE parseContNothing #-}
462 {-# NOINLINE parseContNothing #-}
463− parseContNothing count pst = do
463+ parseContNothing !count !pst = do
464 r <- extract pst
464 r <- extract pst
465 case r of
465 case r of
466 -- IMPORTANT: the n here is from the byte stream parser, that means
466 -- IMPORTANT: the n here is from the byte stream parser, that means
@@ -471,7 +471,7 @@ parseDToK pstep initial extract offset usedCount input cont = do
471 (cont (Success (- n) b) (count - n) None)
471 (cont (Success (- n) b) (count - n) None)
472 ParserD.Continue n pst1 ->
472 ParserD.Continue n pst1 ->
473 assert (n >= 0)
473 assert (n >= 0)
474− (return $ Continue (- n) (parseCont (count - n) pst1))
474+ (return $ Continue (- n) (parseCont SPEC (count - n) pst1))
475 ParserD.Error err ->
475 ParserD.Error err ->
476 -- XXX It is called only when there is no input arr. So using 0
476 -- XXX It is called only when there is no input arr. So using 0
477 -- as the position is correct?
477 -- as the position is correct?
@@ -482,10 +482,10 @@ parseDToK pstep initial extract offset usedCount input cont = do
482 -- Just/Nothing cases here. That may help in avoiding the parseContJust
482 -- Just/Nothing cases here. That may help in avoiding the parseContJust
483 -- function call.
483 -- function call.
484 {-# INLINE parseCont #-}
484 {-# INLINE parseCont #-}
485− parseCont cnt pst (Chunk arr) = parseContChunk cnt 0 pst arr
485+ parseCont _ !cnt !pst (Chunk arr) = parseContChunk cnt 0 pst arr
486− parseCont cnt pst None = parseContNothing cnt pst
486+ parseCont _ !cnt !pst None = parseContNothing cnt pst
488−-- | Convert a raw byte 'Parser' to a chunked parser.
488+-- | Convert a raw byte 'Parser' to a chunked 'ParserK'.
490-- /Pre-release/
490-- /Pre-release/
@@ -540,4 +540,4 @@ toParser parser = ParserD.Parser step initial extract
540{-# RULES "toParser/fromParser fusion" [2]
540{-# RULES "toParser/fromParser fusion" [2]
541 forall s. fromParser (toParser s) = s #-}
541 forall s. fromParser (toParser s) = s #-}