diff options
Diffstat (limited to 'lib/Data/Packed/Internal/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 7 |
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 | |||
20 | import Foreign | 20 | import Foreign |
21 | import Complex | 21 | import Complex |
22 | import Control.Monad(when) | 22 | import Control.Monad(when) |
23 | import 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. |
26 | data Vector t = V { dim :: Int -- ^ number of elements | 25 | data Vector t = V { dim :: Int -- ^ number of elements |
@@ -39,8 +38,8 @@ type Vc t s = Int -> Ptr t -> s | |||
39 | vec = withVector | 38 | vec = withVector |
40 | 39 | ||
41 | withVector (V n fp) f = withForeignPtr fp $ \p -> do | 40 | withVector (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 | ||