Make D.V.Generic.stream strict in the length of the vector
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>
Sun, 23 May 2010 05:51:28 +0000 (05:51 +0000)
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Sun, 23 May 2010 05:51:28 +0000 (05:51 +0000)
Data/Vector/Generic.hs

index 1b795a9..c26bc9b 100644 (file)
@@ -1621,7 +1621,7 @@ unsafeCopy dst src = UNSAFE_CHECK(check) "unsafeCopy" "length mismatch"
 -- | /O(1)/ Convert a vector to a 'Stream'
 stream :: Vector v a => v a -> Stream a
 {-# INLINE_STREAM stream #-}
-stream v = v `seq` (Stream.unfoldr get 0 `Stream.sized` Exact n)
+stream v = v `seq` n `seq` (Stream.unfoldr get 0 `Stream.sized` Exact n)
   where
     n = length v