haskell / haddock

Haskell Documentation Tool
www.haskell.org/haddock/
BSD 2-Clause "Simplified" License
362 stars 242 forks source link

Haddock doesn't show `type instance`s as orphans #1502

Open silky opened 2 years ago

silky commented 2 years ago

It would be really nice if, when I have orphan type instance ... statements, they would show up in the documentation of the file where I'm defining them.

Compare:

-- A.hs
{-# language TypeFamilies #-}

module A where

-- | Some witty observations about the type family.
type family B a :: *

-- | Some insightful observations about this bool instance.
type instance B Bool = Int

image

vs.

--- A.hs
{-# language TypeFamilies #-}

module A where

import B

-- | Some insightful observations about this bool instance.
type instance B Bool = Int
-- B.hs
{-# language TypeFamilies #-}

module B where

-- | Some witty observations about the type family.
type family B a :: *

Now:

image

image

:(

I'd love to see the instance for 'B' defined in the 'A' module. Is there a way to achieve this?