Skip to content

-haddock does not collect documentation on family instances

Summary

Documentation added to type family instances declarations doesn't appear in the .hi file when -haddock is enabled. It looks like it may be related to https://github.com/haskell/haddock/pull/867

Steps to reproduce

Given the file

{-# LANGUAGE TypeFamilies #-}

module TFDocBug where

-- | This is my family
type family F a

-- | Hello world
type instance F Int = Bool

Run ghc -haddock TFDocBug.hs -ddump-hi

Expected behavior

The output of -ddump-hi should contain something near the bottom like

module header:
  Nothing
declaration docs:
  TFDocBug.F:
    " This is my family"
  TFDocBug.$fmangledNameForF.Int
    " Hello world"
arg docs:

The actual output is just

module header:
  Nothing
declaration docs:
  TFDocBug.F:
    " This is my family"
arg docs:

Environment

  • GHC version used: ghc-HEAD

Optional:

  • Operating System: Darwin
Edited by Luke Lau
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information