diff options
Diffstat (limited to 'lib/Data/Packed')
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index dfa2e86..c73ef10 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -339,8 +339,9 @@ unzipVectorWith f g u = unsafePerformIO $ do | |||
339 | return (v,w) | 339 | return (v,w) |
340 | {-# INLINE unzipVectorWith #-} | 340 | {-# INLINE unzipVectorWith #-} |
341 | 341 | ||
342 | foldVector :: Storable a => (a -> b -> b) -> b -> Vector a -> b | ||
342 | foldVector f x v = unsafePerformIO $ | 343 | foldVector f x v = unsafePerformIO $ |
343 | unsafeWith (v::Vector Double) $ \p -> do | 344 | unsafeWith v $ \p -> do |
344 | let go (-1) s = return s | 345 | let go (-1) s = return s |
345 | go !k !s = do y <- peekElemOff p k | 346 | go !k !s = do y <- peekElemOff p k |
346 | go (k-1::Int) (f y s) | 347 | go (k-1::Int) (f y s) |