aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
authorCale Gibbard <cgibbard@gmail.com>2020-02-07 16:53:41 -0500
committerCale Gibbard <cgibbard@gmail.com>2020-04-14 11:43:34 -0400
commit99aa96d641bf9bae036be4a9577fe75c0010424f (patch)
tree4091bfa1ebdf1cf276aab7dbf140e3b3ac51a9d1 /haddock-api
parent5ec817a3e41b7eaa50c74701ab2d7642df86464c (diff)
Add instance of XCollectPat for DocNameI
Diffstat (limited to 'haddock-api')
-rw-r--r--haddock-api/src/Haddock/GhcUtils.hs3
-rw-r--r--haddock-api/src/Haddock/Types.hs2
2 files changed, 4 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs
index 83d23d1b..c870fdf9 100644
--- a/haddock-api/src/Haddock/GhcUtils.hs
+++ b/haddock-api/src/Haddock/GhcUtils.hs
@@ -41,6 +41,7 @@ import GHC.Types.Var.Env ( TyVarEnv, extendVarEnv, elemVarEnv, emptyVarEnv )
import GHC.Core.TyCo.Rep ( Type(..) )
import GHC.Core.Type ( isRuntimeRepVar )
import TysWiredIn( liftedRepDataConTyCon )
+import GHC.Hs.Utils (XCollectPat(..))
import StringBuffer ( StringBuffer )
import qualified StringBuffer as S
@@ -55,7 +56,7 @@ moduleString = moduleNameString . moduleName
isNameSym :: Name -> Bool
isNameSym = isSymOcc . nameOccName
-getMainDeclBinder :: HsDecl (GhcPass p) -> [IdP (GhcPass p)]
+getMainDeclBinder :: (XCollectPat (GhcPass p)) => HsDecl (GhcPass p) -> [IdP (GhcPass p)]
getMainDeclBinder (TyClD _ d) = [tcdName d]
getMainDeclBinder (ValD _ d) =
case collectHsBindBinders d of
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index 1a0b2c79..5086d52c 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -299,6 +299,8 @@ data DocNameI
type instance IdP DocNameI = DocName
+instance XCollectPat DocNameI where
+ collectPatX _ ext = noExtCon ext
instance NamedThing DocName where
getName (Documented name _) = name