From 003b8db7a864bbea3772cd70906153bd36d1f7ac Mon Sep 17 00:00:00 2001 From: Jed Brown Date: Sun, 17 Feb 2008 16:22:34 +0000 Subject: Get Storable instance for Complex from storable-complex. --- lib/Data/Packed/Internal/Common.hs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lib/Data') diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs index 5ac4f5a..baeb5bc 100644 --- a/lib/Data/Packed/Internal/Common.hs +++ b/lib/Data/Packed/Internal/Common.hs @@ -22,16 +22,8 @@ import Control.Monad(when) import Debug.Trace import Foreign.C.String(peekCString) import Foreign.C.Types +import Foreign.Storable.Complex ----------------------------------------------------------------------- -instance (Storable a, RealFloat a) => Storable (Complex a) where -- - alignment x = alignment (realPart x) -- - sizeOf x = 2 * sizeOf (realPart x) -- - peek p = do -- - [re,im] <- peekArray 2 (castPtr p) -- - return (re :+ im) -- - poke p (a :+ b) = pokeArray (castPtr p) [a,b] -- ----------------------------------------------------------------------- -- | @debug x = trace (show x) x@ debug :: (Show a) => a -> a -- cgit v1.2.3