haskellhackagehaddock

Haddock - Data record fields names not being generated


I'm having trouble getting haddock to display the field names of my data records. Some of my data types have many different numeric values, so documenting the names is key.

An example data record:

-- | API response container for daily price history
data PriceHistoryResponse = PriceHistoryResponse {
  responseData :: [PriceHistoryResponseData], -- ^ the actual response, list of price entries
  timeTo       :: Maybe Integer, -- ^ latest price returned
  timeFrom     :: Maybe Integer -- ^ earliest price returned
} deriving (Show, Generic)

The data types in question are being exported like so:

  -- more module exports above ..
  , PriceHistoryResponse(..)
  , PriceHistoryResponseData(..)
  -- more below ...

For this definition (and all others like it), the only documentation being generated is the constructor's type signature. No explanations of values involved are generated, however.

A possibly relevant detail is that I have DuplicateRecordFields enabled in this file.

$ stack exec -- haddock --version                                           
Haddock version 2.17.3

Am I making an obvious error, or just missing something? Happy to provide any other information that would be useful.


Solution

  • The problem was indeed DuplicateRecordFields. The fields generated just fine when I disambiguated and removed the extension.