diff options
Diffstat (limited to 'packages/base/src/Internal/Vector.hs')
-rw-r--r-- | packages/base/src/Internal/Vector.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/base/src/Internal/Vector.hs b/packages/base/src/Internal/Vector.hs index 6271bb6..3037019 100644 --- a/packages/base/src/Internal/Vector.hs +++ b/packages/base/src/Internal/Vector.hs | |||
@@ -32,7 +32,7 @@ import Foreign.ForeignPtr | |||
32 | import Foreign.Ptr | 32 | import Foreign.Ptr |
33 | import Foreign.Storable | 33 | import Foreign.Storable |
34 | import Foreign.C.Types(CInt) | 34 | import Foreign.C.Types(CInt) |
35 | import Data.Int(Int64) | 35 | import Data.Int |
36 | import Data.Complex | 36 | import Data.Complex |
37 | import System.IO.Unsafe(unsafePerformIO) | 37 | import System.IO.Unsafe(unsafePerformIO) |
38 | import GHC.ForeignPtr(mallocPlainForeignPtrBytes) | 38 | import GHC.ForeignPtr(mallocPlainForeignPtrBytes) |
@@ -46,18 +46,18 @@ import Control.Monad(replicateM) | |||
46 | import qualified Data.ByteString.Internal as BS | 46 | import qualified Data.ByteString.Internal as BS |
47 | import Data.Vector.Storable.Internal(updPtr) | 47 | import Data.Vector.Storable.Internal(updPtr) |
48 | 48 | ||
49 | type I = CInt | 49 | type I = Int32 |
50 | type Z = Int64 | 50 | type Z = Int64 |
51 | type R = Double | 51 | type R = Double |
52 | type C = Complex Double | 52 | type C = Complex Double |
53 | 53 | ||
54 | 54 | ||
55 | -- | specialized fromIntegral | 55 | -- | specialized fromIntegral |
56 | fi :: Int -> CInt | 56 | fi :: Int -> Int32 |
57 | fi = fromIntegral | 57 | fi = fromIntegral |
58 | 58 | ||
59 | -- | specialized fromIntegral | 59 | -- | specialized fromIntegral |
60 | ti :: CInt -> Int | 60 | ti :: Int32 -> Int |
61 | ti = fromIntegral | 61 | ti = fromIntegral |
62 | 62 | ||
63 | 63 | ||
@@ -69,7 +69,7 @@ dim = Vector.length | |||
69 | 69 | ||
70 | -- C-Haskell vector adapter | 70 | -- C-Haskell vector adapter |
71 | {-# INLINE avec #-} | 71 | {-# INLINE avec #-} |
72 | avec :: Storable a => Vector a -> (f -> IO r) -> ((CInt -> Ptr a -> f) -> IO r) | 72 | avec :: Storable a => Vector a -> (f -> IO r) -> ((Int32 -> Ptr a -> f) -> IO r) |
73 | avec v f g = unsafeWith v $ \ptr -> f (g (fromIntegral (Vector.length v)) ptr) | 73 | avec v f g = unsafeWith v $ \ptr -> f (g (fromIntegral (Vector.length v)) ptr) |
74 | 74 | ||
75 | -- allocates memory for a new vector | 75 | -- allocates memory for a new vector |