@@ -366,7 +366,7 @@ parseChunk
366366 -> Array a
367367 -> Int
368368 -> m (ChunkResult s b)
369−parseChunk pstep state (Array contents start end) offset = do
369+parseChunk pstep !state (Array contents start end) !offset = do
370370 if offset >= 0
371371 then go SPEC (start + offset * SIZE_OF(a)) state
372372 else return $ ChunkContinue offset state
@@ -427,7 +427,7 @@ parseDToK
427427 -> Input a
428428 -> (ParseResult b -> Int -> Input a -> m (Step a m r))
429429 -> 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
431431 res <- initial
432432 case res of
433433 ParserD.IPartial pst -> do
@@ -442,7 +442,7 @@ parseDToK pstep initial extract offset usedCount input cont = do
442442 -- XXX We can maintain an absolute position instead of relative that will
443443 -- help in reporting of error location in the stream.
444444 {-# NOINLINE parseContChunk #-}
445− parseContChunk count off pst arr = do
445+ parseContChunk !count !off !pst !arr = do
446446 pRes <- parseChunk pstep pst arr off
447447 -- The "n" here is stream position index wrt the array start, and not
448448 -- the backtrack count as returned by byte stream parsers.
@@ -452,15 +452,15 @@ parseDToK pstep initial extract offset usedCount input cont = do
452452 (cont (Success n b) (count + n - off) (Chunk arr))
453453 ChunkPartial n pst1 ->
454454 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))
456456 ChunkContinue n pst1 ->
457457 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))
459459 ChunkError n err ->
460460 cont (Failure n err) (count + n - off) (Chunk arr)
461461
462462 {-# NOINLINE parseContNothing #-}
463− parseContNothing count pst = do
463+ parseContNothing !count !pst = do
464464 r <- extract pst
465465 case r of
466466 -- 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
471471 (cont (Success (- n) b) (count - n) None)
472472 ParserD.Continue n pst1 ->
473473 assert (n >= 0)
474− (return $ Continue (- n) (parseCont (count - n) pst1))
474+ (return $ Continue (- n) (parseCont SPEC (count - n) pst1))
475475 ParserD.Error err ->
476476 -- XXX It is called only when there is no input arr. So using 0
477477 -- as the position is correct?
@@ -482,10 +482,10 @@ parseDToK pstep initial extract offset usedCount input cont = do
482482 -- Just/Nothing cases here. That may help in avoiding the parseContJust
483483 -- function call.
484484 {-# INLINE parseCont #-}
485− parseCont cnt pst (Chunk arr) = parseContChunk cnt 0 pst arr
486− parseCont cnt pst None = parseContNothing cnt pst
485+ parseCont _ !cnt !pst (Chunk arr) = parseContChunk cnt 0 pst arr
486+ parseCont _ !cnt !pst None = parseContNothing cnt pst
487487
488−-- | Convert a raw byte 'Parser' to a chunked parser.
488+-- | Convert a raw byte 'Parser' to a chunked 'ParserK'.
489489--
490490-- /Pre-release/
491491--
@@ -540,4 +540,4 @@ toParser parser = ParserD.Parser step initial extract
540540{-# RULES "toParser/fromParser fusion" [2]
541541 forall s. fromParser (toParser s) = s #-}
542542#endif
543− -}
543+-}