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.hs11
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
32type 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
38vec = withVector 29vec = withVector
39 30
40withVector (V n fp) f = withForeignPtr fp $ \p -> do 31withVector (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