Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : new-typeable

http://hackage.haskell.org/trac/ghc/changeset/56af046fd56de724d3dfc45ade4c24ad4ac87753

>---------------------------------------------------------------

commit 56af046fd56de724d3dfc45ade4c24ad4ac87753
Author: Jose Pedro Magalhaes <[email protected]>
Date:   Fri Sep 21 10:36:46 2012 +0100

    Add missing dataCast1 and dataCast2 methods in Data.Data (FIX #7156)

>---------------------------------------------------------------

 Data/Data.hs |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Data/Data.hs b/Data/Data.hs
index 0a29668..cb2d894 100644
--- a/Data/Data.hs
+++ b/Data/Data.hs
@@ -1275,27 +1275,27 @@ instance (Data a, Data b, Data c, Data d, Data e, Data 
f, Data g)
 
 ------------------------------------------------------------------------------
 
-instance Typeable a => Data (Ptr a) where
+instance (Data a, Typeable a) => Data (Ptr a) where
   toConstr _   = error "Data.Data.toConstr(Ptr)"
   gunfold _ _  = error "Data.Data.gunfold(Ptr)"
   dataTypeOf _ = mkNoRepType "GHC.Ptr.Ptr"
-
+  dataCast1 x  = gcast1 x
 
 ------------------------------------------------------------------------------
 
-instance Typeable a => Data (ForeignPtr a) where
+instance (Data a, Typeable a) => Data (ForeignPtr a) where
   toConstr _   = error "Data.Data.toConstr(ForeignPtr)"
   gunfold _ _  = error "Data.Data.gunfold(ForeignPtr)"
   dataTypeOf _ = mkNoRepType "GHC.ForeignPtr.ForeignPtr"
-
+  dataCast1 x  = gcast1 x
 
 ------------------------------------------------------------------------------
 -- The Data instance for Array preserves data abstraction at the cost of 
 -- inefficiency. We omit reflection services for the sake of data abstraction.
-instance (Typeable a, Data b, Ix a) => Data (Array a b)
+instance (Typeable a, Data a, Data b, Ix a) => Data (Array a b)
  where
   gfoldl f z a = z (listArray (bounds a)) `f` (elems a)
   toConstr _   = error "Data.Data.toConstr(Array)"
   gunfold _ _  = error "Data.Data.gunfold(Array)"
   dataTypeOf _ = mkNoRepType "Data.Array.Array"
-
+  dataCast2 x  = gcast2 x



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to