From 34380f2b5d7b048a4d68197f16a8db0e53742030 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sat, 8 Sep 2007 09:46:33 +0000 Subject: type classes --- lib/Data/Packed/Internal/Common.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/Data/Packed/Internal/Common.hs') diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs index 1bfed6d..1212968 100644 --- a/lib/Data/Packed/Internal/Common.hs +++ b/lib/Data/Packed/Internal/Common.hs @@ -28,7 +28,7 @@ debug x = trace (show x) x data Vector t = V { dim :: Int , fptr :: ForeignPtr t , ptr :: Ptr t - } deriving Typeable + } -- deriving Typeable ---------------------------------------------------------------------- instance (Storable a, RealFloat a) => Storable (Complex a) where -- @@ -78,17 +78,17 @@ check msg ls f = do mapM_ (touchForeignPtr . fptr) ls return () -class (Storable a, Typeable a) => Field a -instance (Storable a, Typeable a) => Field a +--class (Storable a, Typeable a) => Field a +--instance (Storable a, Typeable a) => Field a -isReal :: (Data.Typeable.Typeable a) => (t -> a) -> t -> Bool -isReal w x = typeOf (undefined :: Double) == typeOf (w x) +--isReal :: (Data.Typeable.Typeable a) => (t -> a) -> t -> Bool +--isReal w x = typeOf (undefined :: Double) == typeOf (w x) -isComp :: (Data.Typeable.Typeable a) => (t -> a) -> t -> Bool -isComp w x = typeOf (undefined :: Complex Double) == typeOf (w x) +--isComp :: (Data.Typeable.Typeable a) => (t -> a) -> t -> Bool +--isComp w x = typeOf (undefined :: Complex Double) == typeOf (w x) -scast :: forall a . forall b . (Typeable a, Typeable b) => a -> b -scast = fromJust . cast +--scast :: forall a . forall b . (Typeable a, Typeable b) => a -> b +--scast = fromJust . cast {- | conversion of Haskell functions into function pointers that can be used in the C side -} -- cgit v1.2.3