diff options
Diffstat (limited to 'lib/Data/Packed/Internal/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index ac6588b..1075e64 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -26,20 +26,11 @@ data Vector t = V { dim :: Int -- ^ number of elements | |||
26 | , fptr :: ForeignPtr t -- ^ foreign pointer to the memory block | 26 | , fptr :: ForeignPtr t -- ^ foreign pointer to the memory block |
27 | } | 27 | } |
28 | 28 | ||
29 | --ptr (V _ fptr) = unsafeForeignPtrToPtr fptr | ||
30 | |||
31 | -- | signature of foreign functions admitting C-style vectors | ||
32 | type Vc t s = Int -> Ptr t -> s | ||
33 | -- not yet admitted by my haddock version | ||
34 | -- infixr 5 :> | ||
35 | -- type t :> s = Vc t s | ||
36 | |||
37 | |||
38 | vec = withVector | 29 | vec = withVector |
39 | 30 | ||
40 | withVector (V n fp) f = withForeignPtr fp $ \p -> do | 31 | withVector (V n fp) f = withForeignPtr fp $ \p -> do |
41 | let v g = do | 32 | let v g = do |
42 | g n p | 33 | g (fi n) p |
43 | f v | 34 | f v |
44 | 35 | ||
45 | -- | allocates memory for a new vector | 36 | -- | allocates memory for a new vector |