@@ -627,8 +627,7 @@ replace needle@(Text _ _ neeLen)
627 | otherwise = Text (A.run x) 0 len
627 | otherwise = Text (A.run x) 0 len
629 ixs = indices needle haystack
629 ixs = indices needle haystack
631− len = hayLen - (neeLen - repLen) * cnt
630+ len = hayLen - (neeLen - repLen) * L.length ixs
633 marr <- A.new len
632 marr <- A.new len
634 let loop (i:is) o d = do
633 let loop (i:is) o d = do