summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Vector.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2008-01-22 13:06:13 +0000
committerAlberto Ruiz <aruiz@um.es>2008-01-22 13:06:13 +0000
commitbaeb3890896e424e57582b108f7419f4ae479c42 (patch)
tree09d805dc1460e0530f9e55c31707c65cecb54aa9 /lib/Data/Packed/Internal/Vector.hs
parente92696514c8861e7bed7abb434ca24527861c05c (diff)
CInt in all imports
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