Adding dataCast1 and dataCast2 methods to the Data instances of Ptr, ForeignPtr, and Array

José Pedro Magalhães jpm at cs.uu.nl
Wed Oct 17 10:18:03 CEST 2012


Hello all,

This email is to draw your attention to
http://hackage.haskell.org/trac/ghc/ticket/7256. Missing dataCast1 and
dataCast2 methods in Data instances results in incorrect behaviour when
using SYB's ext1/ext2 functions. The proposed fix adds the methods, but it
requires adding additional Data constraints to these instances. Here's the
relevant part of the diff:

-instance Typeable a => Data (Ptr a) where
> +instance (Data a, Typeable a) => Data (Ptr a) where
>
> -instance Typeable a => Data (ForeignPtr a) where
> +instance (Data a, Typeable a) => Data (ForeignPtr a) where
>
> -instance (Typeable a, Data b, Ix a) => Data (Array a b)
> +instance (Typeable a, Data a, Data b, Ix a) => Data (Array a b)
>

Does anyone find this change problematic?


Cheers,
Pedro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20121017/8fa19d85/attachment.htm>


More information about the Libraries mailing list