on master help sign in
Make streaming cons strict in its first argument
e280babBryan O'Sullivan
Data/Text/Fusion/Common.hs+1−1
@@ -172,7 +172,7 @@ data C s = C0 !s
172
172
173-- | /O(n)/ Adds a character to the front of a Stream Char.
173-- | /O(n)/ Adds a character to the front of a Stream Char.
174cons :: Char -> Stream Char -> Stream Char
174cons :: Char -> Stream Char -> Stream Char
175−cons w (Stream next0 s0 len) = Stream next (C1 s0) (len+1)
175+cons !w (Stream next0 s0 len) = Stream next (C1 s0) (len+1)
176 where
176 where
177 next (C1 s) = Yield w (C0 s)
177 next (C1 s) = Yield w (C0 s)
178 next (C0 s) = case next0 s of
178 next (C0 s) = case next0 s of