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.
DuplicateRecordFields
' fault. Basically, that extension removes all record labels and replaces them with class methods and Haddock has seemingly no way to reverse this process. I was never a fan of that extension; are you sure you need to go that way? Usinglens
'makeFields
on records with unambiguous field names seems so much more versatile to me. – leftaroundabout