From 99aa96d641bf9bae036be4a9577fe75c0010424f Mon Sep 17 00:00:00 2001 From: Cale Gibbard Date: Fri, 7 Feb 2020 16:53:41 -0500 Subject: Add instance of XCollectPat for DocNameI --- haddock-api/src/Haddock/GhcUtils.hs | 3 ++- haddock-api/src/Haddock/Types.hs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'haddock-api/src/Haddock') 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 -- cgit v1.2.3 From b6bebdce0f217af8b6a249b3b6c2bd32dfa2b0b0 Mon Sep 17 00:00:00 2001 From: Cale Gibbard Date: Wed, 8 Apr 2020 13:39:15 -0400 Subject: Rename XCollectPat -> CollectPass --- haddock-api/src/Haddock/GhcUtils.hs | 4 ++-- haddock-api/src/Haddock/Types.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'haddock-api/src/Haddock') diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index c870fdf9..6b62f3d3 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -41,7 +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 GHC.Hs.Utils (CollectPass(..)) import StringBuffer ( StringBuffer ) import qualified StringBuffer as S @@ -56,7 +56,7 @@ moduleString = moduleNameString . moduleName isNameSym :: Name -> Bool isNameSym = isSymOcc . nameOccName -getMainDeclBinder :: (XCollectPat (GhcPass p)) => HsDecl (GhcPass p) -> [IdP (GhcPass p)] +getMainDeclBinder :: (CollectPass (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 5086d52c..f12a6bce 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -299,8 +299,8 @@ data DocNameI type instance IdP DocNameI = DocName -instance XCollectPat DocNameI where - collectPatX _ ext = noExtCon ext +instance CollectPass DocNameI where + collectXXPat _ ext = noExtCon ext instance NamedThing DocName where getName (Documented name _) = name -- cgit v1.2.3