Am Mittwoch, 31. Dezember 2003 17:48 schrieben Sie:
Wolfgang Jeltsch wrote:
I have a datatype Relation element1 element2 which derives an Eq instance. In the Haddock-generated documentation the instances section of Relation says (Ord element1, Ord element2, ??? element1 element2) => [...]. Why does Haddock generate this mysterious ??? element1 element2 context?
Haddock doesn't do any real type inference, it only handles some "easy" cases for deriving clauses. If you want nice documentation, you have to fake things a little bit (cut-n-paste from my OpenGL stuff):
------------------------------------------------------------------------ data GLmatrix a = GLmatrix MatrixOrder (ForeignPtr a) #ifdef __HADDOCK__ -- Help Haddock a bit, because it doesn't do any instance inference. instance Eq (GLmatrix a) instance Ord (GLmatrix a) instance Show (GLmatrix a) #else deriving ( Eq, Ord, Show ) #endif ------------------------------------------------------------------------
How do I instruct Haddock to preprocess the Haskell files. From your mail I thought that Haddock would do so by default but it complains at the first #ifdef it sees. Unfortunately, I didn't find any Haddock option similar to Hugs' -F.
Cheers, S.
Wolfgang