Skip to content

Add additional context to :doc output (#19055)

Aaron Allen requested to merge aaronallen8455/ghc:aallen/#19055 into master

This MR adds additional output to the GHCi :doc command that gives the user some identifying information to go along with an object's docs. This can help to delineate results in cases where there are multiple matches, such as type/data constructor punning or duplicate record fields.

Example:

-- | Doc for type constructor
data Foo a =
  -- | Doc for data constructor
  Foo a

>>>> :doc Foo
Foo :: a -> Foo a       -- Data constructor defined at Docs.hs:17:3
 Doc for data constructor

Foo :: * -> *   -- Type constructor defined at Docs.hs:15:1
 Doc for type constructor

closes #19055 (closed)

Merge request reports