3

I'm trying to document some very scary type-class constraints and explaining why they're required, but I can't seem to get the following working in Haddock:

{-|

This will show-up at the top of the module

-}

module Try where

-- | This shows up immediately after the class "header"
class (

    -- | PROBLEM: This doesn't work...
    Show a -- ^ PROBLEM: Also, this doesn't work

    ) => Something a where

    -- | This shows up as the method's documentation
    something :: a -> Int
Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60

1 Answers1

1

There isn't any way to make this work with the latest version of Haddock.

This idea has been brought up before in passing: https://github.com/haskell/haddock/issues/472#issuecomment-257136046. I wouldn't hold my breath though - this would require some really core changes to how Haddock stores doc strings.

Alec
  • 31,829
  • 7
  • 67
  • 114