diff options
Diffstat (limited to 'lib/Data')
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 12 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 7 | ||||
-rw-r--r-- | lib/Data/Packed/Matrix.hs | 5 | ||||
-rw-r--r-- | lib/Data/Packed/ST.hs | 12 |
4 files changed, 27 insertions, 9 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 57142b7..d5fa5a0 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -39,10 +39,14 @@ import Data.Packed.Internal.Common | |||
39 | import Data.Packed.Internal.Signatures | 39 | import Data.Packed.Internal.Signatures |
40 | import Data.Packed.Internal.Vector | 40 | import Data.Packed.Internal.Vector |
41 | 41 | ||
42 | import Foreign hiding (xor) | 42 | import Foreign.Marshal.Alloc(alloca, free) |
43 | import Data.Complex | 43 | import Foreign.Marshal.Array(newArray) |
44 | import Foreign.C.Types | 44 | import Foreign.Ptr(Ptr, castPtr) |
45 | import Foreign.C.String | 45 | import Foreign.Storable(Storable, peekElemOff, pokeElemOff, poke, sizeOf) |
46 | import Data.Complex(Complex) | ||
47 | import Foreign.C.Types(CInt, CChar) | ||
48 | import Foreign.C.String(newCString) | ||
49 | import System.IO.Unsafe(unsafePerformIO) | ||
46 | 50 | ||
47 | ----------------------------------------------------------------- | 51 | ----------------------------------------------------------------- |
48 | 52 | ||
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index 8f403f4..e5a7782 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -32,11 +32,16 @@ module Data.Packed.Internal.Vector ( | |||
32 | 32 | ||
33 | import Data.Packed.Internal.Common | 33 | import Data.Packed.Internal.Common |
34 | import Data.Packed.Internal.Signatures | 34 | import Data.Packed.Internal.Signatures |
35 | import Foreign | 35 | import Foreign.Marshal.Alloc(free) |
36 | import Foreign.Marshal.Array(peekArray, pokeArray, copyArray, advancePtr) | ||
37 | import Foreign.ForeignPtr(ForeignPtr, castForeignPtr) | ||
38 | import Foreign.Ptr(Ptr) | ||
39 | import Foreign.Storable(Storable, peekElemOff, pokeElemOff, sizeOf) | ||
36 | import Foreign.C.String | 40 | import Foreign.C.String |
37 | import Foreign.C.Types(CInt,CChar) | 41 | import Foreign.C.Types(CInt,CChar) |
38 | import Data.Complex | 42 | import Data.Complex |
39 | import Control.Monad(when) | 43 | import Control.Monad(when) |
44 | import System.IO.Unsafe(unsafePerformIO) | ||
40 | 45 | ||
41 | #if __GLASGOW_HASKELL__ >= 605 | 46 | #if __GLASGOW_HASKELL__ >= 605 |
42 | import GHC.ForeignPtr (mallocPlainForeignPtrBytes) | 47 | import GHC.ForeignPtr (mallocPlainForeignPtrBytes) |
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs index 0b23b2f..27fa36c 100644 --- a/lib/Data/Packed/Matrix.hs +++ b/lib/Data/Packed/Matrix.hs | |||
@@ -42,9 +42,10 @@ module Data.Packed.Matrix ( | |||
42 | 42 | ||
43 | import Data.Packed.Internal | 43 | import Data.Packed.Internal |
44 | import qualified Data.Packed.ST as ST | 44 | import qualified Data.Packed.ST as ST |
45 | import Data.List(transpose,intersperse) | ||
46 | import Data.Array | 45 | import Data.Array |
47 | import Foreign.Storable | 46 | |
47 | import Data.List(transpose,intersperse) | ||
48 | import Foreign.Storable(Storable) | ||
48 | import Control.Arrow((***)) | 49 | import Control.Arrow((***)) |
49 | 50 | ||
50 | ------------------------------------------------------------------- | 51 | ------------------------------------------------------------------- |
diff --git a/lib/Data/Packed/ST.hs b/lib/Data/Packed/ST.hs index 2fad6ae..22aff07 100644 --- a/lib/Data/Packed/ST.hs +++ b/lib/Data/Packed/ST.hs | |||
@@ -1,3 +1,4 @@ | |||
1 | {-# LANGUAGE CPP #-} | ||
1 | {-# LANGUAGE TypeOperators #-} | 2 | {-# LANGUAGE TypeOperators #-} |
2 | {-# LANGUAGE Rank2Types #-} | 3 | {-# LANGUAGE Rank2Types #-} |
3 | {-# LANGUAGE BangPatterns #-} | 4 | {-# LANGUAGE BangPatterns #-} |
@@ -33,8 +34,15 @@ module Data.Packed.ST ( | |||
33 | ) where | 34 | ) where |
34 | 35 | ||
35 | import Data.Packed.Internal | 36 | import Data.Packed.Internal |
36 | import Control.Monad.ST | 37 | |
37 | import Foreign | 38 | import Control.Monad.ST(ST, runST) |
39 | import Foreign.Storable(Storable, peekElemOff, pokeElemOff) | ||
40 | |||
41 | #if MIN_VERSION_base(4,4,0) | ||
42 | import Control.Monad.ST.Unsafe(unsafeIOToST) | ||
43 | #else | ||
44 | import Control.Monad.ST(unsafeIOToST) | ||
45 | #endif | ||
38 | 46 | ||
39 | {-# INLINE ioReadV #-} | 47 | {-# INLINE ioReadV #-} |
40 | ioReadV :: Storable t => Vector t -> Int -> IO t | 48 | ioReadV :: Storable t => Vector t -> Int -> IO t |