How can I derive a Data instance for a GADT in Haskell?
问题 I have a GADT which is only ever used with two different parameters, ForwardPossible and (): -- | Used when a forward definition is possible. data ForwardPossible = ForwardPossible deriving (Eq, Ord, Typeable, Data, Show) -- | GADT which accepts forward definitions if parameter is ForwardPossible. data OrForward t forward where OFKnown :: t -> OrForward t forward OFForward :: NamespaceID -> SrcSpan -> BS.ByteString -> OrForward t ForwardPossible deriving instance Eq t => Eq (OrForward t