This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
Hoogle backend oddities with type families #806
Closed
Description
Take this file:
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Bug where
import Data.Proxy
-- | 'F' docs
type family F
-- | 'D' docs
data family D
v :: Int
v = 42
-- | 'C' docs
class C a where
-- | 'AT' docs
type AT a
type AT a = Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy)))))))))
And run haddock --hoogle --package-name=bug --package-version=0.0.0 Bug.hs
, you'll get the following bug.txt
file:
-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
@package bug
@version 0.0.0
module Bug
-- | <a>F</a> docs
-- | <a>D</a> docs
v :: Int
-- | <a>C</a> docs
class C a where {
type family AT a;
type AT a =
Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy)))))))));
}
There are many things wrong here:
- Neither
F
norD
show up at all! This causesv
to have a completely incorrect docstring associated with it. AT
does show up, but it's missing its Haddocks.- The default definition for
AT
spans multiple lines. According to @ndmitchell (in Search doesn't find top-level type families ndmitchell/hoogle#249 (comment)), this should never happen, as Hoogle is line-orientated.