diff options
author | Alberto Ruiz <aruiz@um.es> | 2008-01-22 13:06:13 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2008-01-22 13:06:13 +0000 |
commit | baeb3890896e424e57582b108f7419f4ae479c42 (patch) | |
tree | 09d805dc1460e0530f9e55c31707c65cecb54aa9 /lib/Data/Packed/Internal/Vector.hs | |
parent | e92696514c8861e7bed7abb434ca24527861c05c (diff) |
CInt in all imports
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 |