on master help sign in
Fix a subtle laziness bug - thanks, QuickCheck!
b83e6b7Bryan O'Sullivan
Data/Text/IO/Internal.hs+1−1
@@ -105,7 +105,7 @@ unpack_nl !buf !r !w
105 | otherwise = withRawBuffer buf $ go
105 | otherwise = withRawBuffer buf $ go
106 where
106 where
107 go pbuf = do
107 go pbuf = do
108− let t = unstream (Stream next r (maxSize (w-r)))
108+ let !t = unstream (Stream next r (maxSize (w-r)))
109 w' = w - 1
109 w' = w - 1
110 return $ if ix w' == '\r'
110 return $ if ix w' == '\r'
111 then (t,w')
111 then (t,w')