From 4e6c686dd496e9b7bdd209da3e8fbd3ac47de65a Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Thu, 1 Sep 2011 14:25:37 +0000 Subject: Get rid of some deprecation warnings & Use more explicit imports --- lib/Data/Packed/Internal/Matrix.hs | 12 ++++++++---- lib/Data/Packed/Internal/Vector.hs | 7 ++++++- lib/Data/Packed/Matrix.hs | 5 +++-- lib/Data/Packed/ST.hs | 12 ++++++++++-- 4 files changed, 27 insertions(+), 9 deletions(-) (limited to 'lib/Data') 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 import Data.Packed.Internal.Signatures import Data.Packed.Internal.Vector -import Foreign hiding (xor) -import Data.Complex -import Foreign.C.Types -import Foreign.C.String +import Foreign.Marshal.Alloc(alloca, free) +import Foreign.Marshal.Array(newArray) +import Foreign.Ptr(Ptr, castPtr) +import Foreign.Storable(Storable, peekElemOff, pokeElemOff, poke, sizeOf) +import Data.Complex(Complex) +import Foreign.C.Types(CInt, CChar) +import Foreign.C.String(newCString) +import System.IO.Unsafe(unsafePerformIO) ----------------------------------------------------------------- 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 ( import Data.Packed.Internal.Common import Data.Packed.Internal.Signatures -import Foreign +import Foreign.Marshal.Alloc(free) +import Foreign.Marshal.Array(peekArray, pokeArray, copyArray, advancePtr) +import Foreign.ForeignPtr(ForeignPtr, castForeignPtr) +import Foreign.Ptr(Ptr) +import Foreign.Storable(Storable, peekElemOff, pokeElemOff, sizeOf) import Foreign.C.String import Foreign.C.Types(CInt,CChar) import Data.Complex import Control.Monad(when) +import System.IO.Unsafe(unsafePerformIO) #if __GLASGOW_HASKELL__ >= 605 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 ( import Data.Packed.Internal import qualified Data.Packed.ST as ST -import Data.List(transpose,intersperse) import Data.Array -import Foreign.Storable + +import Data.List(transpose,intersperse) +import Foreign.Storable(Storable) import Control.Arrow((***)) ------------------------------------------------------------------- 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 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE BangPatterns #-} @@ -33,8 +34,15 @@ module Data.Packed.ST ( ) where import Data.Packed.Internal -import Control.Monad.ST -import Foreign + +import Control.Monad.ST(ST, runST) +import Foreign.Storable(Storable, peekElemOff, pokeElemOff) + +#if MIN_VERSION_base(4,4,0) +import Control.Monad.ST.Unsafe(unsafeIOToST) +#else +import Control.Monad.ST(unsafeIOToST) +#endif {-# INLINE ioReadV #-} ioReadV :: Storable t => Vector t -> Int -> IO t -- cgit v1.2.3