summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Vector.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Internal/Vector.hs')
-rw-r--r--lib/Data/Packed/Internal/Vector.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs
index 7eee5fe..ac6588b 100644
--- a/lib/Data/Packed/Internal/Vector.hs
+++ b/lib/Data/Packed/Internal/Vector.hs
@@ -20,7 +20,6 @@ import Data.Packed.Internal.Common
20import Foreign 20import Foreign
21import Complex 21import Complex
22import Control.Monad(when) 22import Control.Monad(when)
23import Data.List(transpose)
24 23
25-- | A one-dimensional array of objects stored in a contiguous memory block. 24-- | A one-dimensional array of objects stored in a contiguous memory block.
26data Vector t = V { dim :: Int -- ^ number of elements 25data Vector t = V { dim :: Int -- ^ number of elements
@@ -39,8 +38,8 @@ type Vc t s = Int -> Ptr t -> s
39vec = withVector 38vec = withVector
40 39
41withVector (V n fp) f = withForeignPtr fp $ \p -> do 40withVector (V n fp) f = withForeignPtr fp $ \p -> do
42 let v f = do 41 let v g = do
43 f n p 42 g n p
44 f v 43 f v
45 44
46-- | allocates memory for a new vector 45-- | allocates memory for a new vector
@@ -132,7 +131,7 @@ join as = unsafePerformIO $ do
132 joiner as tot ptr 131 joiner as tot ptr
133 return r 132 return r
134 where joiner [] _ _ = return () 133 where joiner [] _ _ = return ()
135 joiner (r@V {dim = n, fptr = b} : cs) _ p = do 134 joiner (V {dim = n, fptr = b} : cs) _ p = do
136 withForeignPtr b $ \pb -> copyArray p pb n 135 withForeignPtr b $ \pb -> copyArray p pb n
137 joiner cs 0 (advancePtr p n) 136 joiner cs 0 (advancePtr p n)
138 137