Hello everybody, I urgently need Haddock support for type operators like in the following code snippet: infix 2 :::, := infixl 9 :.: data name ::: value = name := value newtype Composition f g a = Composition { runComposition :: f (g a) } type (:.:) = Composition Does anybody know whether this is easy to implement or whether there is a quick hack to make this work? Can I do the hacking myself or is deeper knowledge of the Haddock source code necessary to provide this feature? Thank you in advance for any help. Best wishes, Wolfgang
Am Mittwoch, 18. April 2007 19:29 schrieb Wolfgang Jeltsch:
Hello everybody,
I urgently need Haddock support for type operators like in the following code snippet:
infix 2 :::, := infixl 9 :.:
data name ::: value = name := value newtype Composition f g a = Composition { runComposition :: f (g a) } type (:.:) = Composition
Does anybody know whether this is easy to implement or whether there is a quick hack to make this work? Can I do the hacking myself or is deeper knowledge of the Haddock source code necessary to provide this feature?
Thank you in advance for any help.
Best wishes, Wolfgang
Hello again, after looking a bit at the source code and coming to the conclusion that it doesn’t look too scary ;-) , I’ve started to make the necessary modifications myself. The result of my hacking is attached as a darcs patch. Note that this is really a hack. One additional parser conflict is added. Neither the parser nor the renderer considers any fixity declarations. Infix operator applications are always rendered without parantheses. But for me it works! :-) Best wishes, Wolfgang
On Wed, Apr 18, 2007 at 07:29:21PM +0200, Wolfgang Jeltsch wrote:
Hello everybody,
I urgently need Haddock support for type operators like in the following code snippet:
infix 2 :::, := infixl 9 :.:
data name ::: value = name := value newtype Composition f g a = Composition { runComposition :: f (g a) } type (:.:) = Composition
Does anybody know whether this is easy to implement or whether there is a quick hack to make this work? Can I do the hacking myself or is deeper knowledge of the Haddock source code necessary to provide this feature?
Thank you in advance for any help.
A much better solution would be to upgrade to David Waern's expiremental fork of Haddock, which does parsing using the GHC API and can handle all the syntactic constructs GHC can: http://darcs.haskell.org/SoC/haddock.ghc/ Note that this installs an executable named 'haddock' which is sufficiently incompatible command line wise with the standard haddock to break Cabal's haddock support; you can work around this with (when configuring a program you want to haddock) --with-haddock=/path/to/old/haddock. Stefan
Am Donnerstag, 19. April 2007 00:20 schrieben Sie:
On Wed, Apr 18, 2007 at 07:29:21PM +0200, Wolfgang Jeltsch wrote:
Hello everybody,
I urgently need Haddock support for type operators like in the following code snippet:
infix 2 :::, := infixl 9 :.:
data name ::: value = name := value newtype Composition f g a = Composition { runComposition :: f (g a) } type (:.:) = Composition
Does anybody know whether this is easy to implement or whether there is a quick hack to make this work? Can I do the hacking myself or is deeper knowledge of the Haddock source code necessary to provide this feature?
Thank you in advance for any help.
A much better solution would be to upgrade to David Waern's expiremental fork of Haddock, which does parsing using the GHC API and can handle all the syntactic constructs GHC can:
How mature is this? Is this an already finished Summer of Code project?
Note that this installs an executable named 'haddock' which is sufficiently incompatible command line wise with the standard haddock to break Cabal's haddock support; you can work around this with (when configuring a program you want to haddock) --with-haddock=/path/to/old/haddock.
Hmm, in the light of this I might stay with the old Haddock modified by my patch. I’d like Cabal’s Haddock support to work.
Stefan
Wolfgang
On Thu, 2007-04-19 at 09:31 +0200, Wolfgang Jeltsch wrote:
A much better solution would be to upgrade to David Waern's expiremental fork of Haddock, which does parsing using the GHC API and can handle all the syntactic constructs GHC can:
How mature is this? Is this an already finished Summer of Code project?
It was a project from last summer.
Note that this installs an executable named 'haddock' which is sufficiently incompatible command line wise with the standard haddock to break Cabal's haddock support; you can work around this with (when configuring a program you want to haddock) --with-haddock=/path/to/old/haddock.
Hmm, in the light of this I might stay with the old Haddock modified by my patch. I’d like Cabal’s Haddock support to work.
David has provided a Cabal patch to handle both the current haddock 0.x series and the haddock-2.x series arising out of his work. I have not yet got round to reviewing and applying his patch. I knew there was something I was supposed to be doing... :-) Duncan
participants (3)
-
Duncan Coutts -
Stefan O'Rear -
Wolfgang Jeltsch