I'm writing an open source patch to use a font library, or rather the haskell bindings to a font library in C (FTGL). I'm pointing to the Font type in one of the data structures, which is defined as follows:
type Font = Ptr Font_Opaque
data Font_Opaque
Unfortunately, to fit into the data structure of the library I'm patching, this type needs to be an instance of Data. Ptr already is, but Font_Opaque obviously isn't, so the compiler complains.
As it's an opaque type I'm not sure how to proceed ... how to implement Data Font_Opaque in a more or less sensible way? Is there a sensible way?
deriving instance Data Font_Opaque
(enable theStandaloneDeriving
extension first) and then (if GHC can derive) look at the instance with-ddump-deriv
. – András Kovács