From d8d8024ad6796549a8d3b5512dabf3288d14e30f Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Thu, 25 Mar 2021 21:23:07 +0000 Subject: EPA : Rename ApiAnn to EpAnn --- haddock-api/src/Haddock/Types.hs | 47 +++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 25 deletions(-) (limited to 'haddock-api/src/Haddock/Types.hs') diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 5c6f09a3..d9943e55 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -727,38 +727,35 @@ type instance Anno (HsOuterTyVarBndrs Specificity DocNameI) = SrcSpanAnnA type instance Anno (HsSigType DocNameI) = SrcSpanAnnA type XRecCond a - = ( XParTy a ~ ApiAnn' AnnParen - -- , XParTy (NoGhcTc a) ~ ApiAnn' AnnParen - -- , NoGhcTcPass (NoGhcTcPass a) ~ NoGhcTcPass a - -- , IsPass a + = ( XParTy a ~ EpAnn' AnnParen , NoGhcTc a ~ a , MapXRec a , UnXRec a , WrapXRec a (HsType a) ) -type instance XForAllTy DocNameI = ApiAnn -type instance XQualTy DocNameI = ApiAnn -type instance XTyVar DocNameI = ApiAnn -type instance XStarTy DocNameI = ApiAnn -type instance XAppTy DocNameI = ApiAnn -type instance XAppKindTy DocNameI = ApiAnn -type instance XFunTy DocNameI = ApiAnn -type instance XListTy DocNameI = ApiAnn' AnnParen -type instance XTupleTy DocNameI = ApiAnn' AnnParen -type instance XSumTy DocNameI = ApiAnn' AnnParen -type instance XOpTy DocNameI = ApiAnn -type instance XParTy DocNameI = ApiAnn' AnnParen -type instance XIParamTy DocNameI = ApiAnn -type instance XKindSig DocNameI = ApiAnn +type instance XForAllTy DocNameI = EpAnn +type instance XQualTy DocNameI = EpAnn +type instance XTyVar DocNameI = EpAnn +type instance XStarTy DocNameI = EpAnn +type instance XAppTy DocNameI = EpAnn +type instance XAppKindTy DocNameI = EpAnn +type instance XFunTy DocNameI = EpAnn +type instance XListTy DocNameI = EpAnn' AnnParen +type instance XTupleTy DocNameI = EpAnn' AnnParen +type instance XSumTy DocNameI = EpAnn' AnnParen +type instance XOpTy DocNameI = EpAnn +type instance XParTy DocNameI = EpAnn' AnnParen +type instance XIParamTy DocNameI = EpAnn +type instance XKindSig DocNameI = EpAnn type instance XSpliceTy DocNameI = Void -- see `renameHsSpliceTy` -type instance XDocTy DocNameI = ApiAnn -type instance XBangTy DocNameI = ApiAnn -type instance XRecTy DocNameI = ApiAnn -type instance XExplicitListTy DocNameI = ApiAnn -type instance XExplicitTupleTy DocNameI = ApiAnn -type instance XTyLit DocNameI = ApiAnn -type instance XWildCardTy DocNameI = ApiAnn +type instance XDocTy DocNameI = EpAnn +type instance XBangTy DocNameI = EpAnn +type instance XRecTy DocNameI = EpAnn +type instance XExplicitListTy DocNameI = EpAnn +type instance XExplicitTupleTy DocNameI = EpAnn +type instance XTyLit DocNameI = EpAnn +type instance XWildCardTy DocNameI = EpAnn type instance XXType DocNameI = HsCoreTy type instance XHsForAllVis DocNameI = NoExtField -- cgit v1.2.3 From 72118896464f94d81f10c52f5d9261efcacc57a6 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Tue, 11 May 2021 10:00:06 +0200 Subject: Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman --- haddock-api/src/Haddock/Convert.hs | 14 +++++------- haddock-api/src/Haddock/GhcUtils.hs | 6 ++--- haddock-api/src/Haddock/Types.hs | 44 ++++++++++++++++++------------------- 3 files changed, 31 insertions(+), 33 deletions(-) (limited to 'haddock-api/src/Haddock/Types.hs') diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 19630077..f8d85f88 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -19,8 +19,6 @@ module Haddock.Convert ( PrintRuntimeReps(..), ) where -#include "HsVersions.h" - import GHC.Data.Bag ( emptyBag ) import GHC.Types.Basic ( TupleSort(..), PromotionFlag(..), DefMethSpec(..), TopLevelFlag(..) ) import GHC.Types.SourceText (SourceText(..)) @@ -47,9 +45,9 @@ import GHC.Builtin.Types ( eqTyConName, listTyConName, liftedTypeKindTyConName import GHC.Builtin.Names ( hasKey, eqTyConKey, ipClassKey, tYPETyConKey , liftedDataConKey, boxedRepDataConKey ) import GHC.Types.Unique ( getUnique ) -import GHC.Utils.Misc ( chkAppend, debugIsOn, dropList, equalLength +import GHC.Utils.Misc ( chkAppend, dropList, equalLength , filterByList, filterOut ) -import GHC.Utils.Panic ( assertPanic ) +import GHC.Utils.Panic.Plain ( assert ) import GHC.Types.Var import GHC.Types.Var.Set import GHC.Types.SrcLoc @@ -933,8 +931,8 @@ tcSplitForAllTysReqPreserveSynonyms :: Type -> ([ReqTVBinder], Type) tcSplitForAllTysReqPreserveSynonyms ty = let (all_bndrs, body) = tcSplitSomeForAllTysPreserveSynonyms isVisibleArgFlag ty req_bndrs = mapMaybe mk_req_bndr_maybe all_bndrs in - ASSERT( req_bndrs `equalLength` all_bndrs ) - (req_bndrs, body) + assert ( req_bndrs `equalLength` all_bndrs) + (req_bndrs, body) where mk_req_bndr_maybe :: TyCoVarBinder -> Maybe ReqTVBinder mk_req_bndr_maybe (Bndr tv argf) = case argf of @@ -946,8 +944,8 @@ tcSplitForAllTysInvisPreserveSynonyms :: Type -> ([InvisTVBinder], Type) tcSplitForAllTysInvisPreserveSynonyms ty = let (all_bndrs, body) = tcSplitSomeForAllTysPreserveSynonyms isInvisibleArgFlag ty inv_bndrs = mapMaybe mk_inv_bndr_maybe all_bndrs in - ASSERT( inv_bndrs `equalLength` all_bndrs ) - (inv_bndrs, body) + assert ( inv_bndrs `equalLength` all_bndrs) + (inv_bndrs, body) where mk_inv_bndr_maybe :: TyCoVarBinder -> Maybe InvisTVBinder mk_inv_bndr_maybe (Bndr tv argf) = case argf of diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 2fc42131..1d6b8bc3 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -338,7 +338,7 @@ reparenTypePrec = go where -- Shorter name for 'reparenType' - go :: XParTy a ~ EpAnn' AnnParen => Precedence -> HsType a -> HsType a + go :: XParTy a ~ EpAnn AnnParen => Precedence -> HsType a -> HsType a go _ (HsBangTy x b ty) = HsBangTy x b (reparenLType ty) go _ (HsTupleTy x con tys) = HsTupleTy x con (map reparenLType tys) go _ (HsSumTy x tys) = HsSumTy x (map reparenLType tys) @@ -378,11 +378,11 @@ reparenTypePrec = go go _ t@XHsType{} = t -- Located variant of 'go' - goL :: XParTy a ~ EpAnn' AnnParen => Precedence -> LHsType a -> LHsType a + goL :: XParTy a ~ EpAnn AnnParen => Precedence -> LHsType a -> LHsType a goL ctxt_prec = mapXRec @a (go ctxt_prec) -- Optionally wrap a type in parens - paren :: XParTy a ~ EpAnn' AnnParen + paren :: XParTy a ~ EpAnn AnnParen => Precedence -- Precedence of context -> Precedence -- Precedence of top-level operator -> HsType a -> HsType a -- Wrap in parens if (ctxt >= op) diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index d9943e55..7c4aeb80 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -727,35 +727,35 @@ type instance Anno (HsOuterTyVarBndrs Specificity DocNameI) = SrcSpanAnnA type instance Anno (HsSigType DocNameI) = SrcSpanAnnA type XRecCond a - = ( XParTy a ~ EpAnn' AnnParen + = ( XParTy a ~ EpAnn AnnParen , NoGhcTc a ~ a , MapXRec a , UnXRec a , WrapXRec a (HsType a) ) -type instance XForAllTy DocNameI = EpAnn -type instance XQualTy DocNameI = EpAnn -type instance XTyVar DocNameI = EpAnn -type instance XStarTy DocNameI = EpAnn -type instance XAppTy DocNameI = EpAnn -type instance XAppKindTy DocNameI = EpAnn -type instance XFunTy DocNameI = EpAnn -type instance XListTy DocNameI = EpAnn' AnnParen -type instance XTupleTy DocNameI = EpAnn' AnnParen -type instance XSumTy DocNameI = EpAnn' AnnParen -type instance XOpTy DocNameI = EpAnn -type instance XParTy DocNameI = EpAnn' AnnParen -type instance XIParamTy DocNameI = EpAnn -type instance XKindSig DocNameI = EpAnn +type instance XForAllTy DocNameI = EpAnn [AddEpAnn] +type instance XQualTy DocNameI = EpAnn [AddEpAnn] +type instance XTyVar DocNameI = EpAnn [AddEpAnn] +type instance XStarTy DocNameI = EpAnn [AddEpAnn] +type instance XAppTy DocNameI = EpAnn [AddEpAnn] +type instance XAppKindTy DocNameI = EpAnn [AddEpAnn] +type instance XFunTy DocNameI = EpAnn [AddEpAnn] +type instance XListTy DocNameI = EpAnn AnnParen +type instance XTupleTy DocNameI = EpAnn AnnParen +type instance XSumTy DocNameI = EpAnn AnnParen +type instance XOpTy DocNameI = EpAnn [AddEpAnn] +type instance XParTy DocNameI = EpAnn AnnParen +type instance XIParamTy DocNameI = EpAnn [AddEpAnn] +type instance XKindSig DocNameI = EpAnn [AddEpAnn] type instance XSpliceTy DocNameI = Void -- see `renameHsSpliceTy` -type instance XDocTy DocNameI = EpAnn -type instance XBangTy DocNameI = EpAnn -type instance XRecTy DocNameI = EpAnn -type instance XExplicitListTy DocNameI = EpAnn -type instance XExplicitTupleTy DocNameI = EpAnn -type instance XTyLit DocNameI = EpAnn -type instance XWildCardTy DocNameI = EpAnn +type instance XDocTy DocNameI = EpAnn [AddEpAnn] +type instance XBangTy DocNameI = EpAnn [AddEpAnn] +type instance XRecTy DocNameI = EpAnn [AddEpAnn] +type instance XExplicitListTy DocNameI = EpAnn [AddEpAnn] +type instance XExplicitTupleTy DocNameI = EpAnn [AddEpAnn] +type instance XTyLit DocNameI = EpAnn [AddEpAnn] +type instance XWildCardTy DocNameI = EpAnn [AddEpAnn] type instance XXType DocNameI = HsCoreTy type instance XHsForAllVis DocNameI = NoExtField -- cgit v1.2.3 From bbaa3dfbf6ea4e0ad1356622ce7750ba76076b7d Mon Sep 17 00:00:00 2001 From: Hécate Moonlight Date: Tue, 11 May 2021 10:14:47 +0200 Subject: Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. --- haddock-api/src/Haddock/Convert.hs | 14 +++++++----- haddock-api/src/Haddock/GhcUtils.hs | 6 ++--- haddock-api/src/Haddock/Types.hs | 44 ++++++++++++++++++------------------- 3 files changed, 33 insertions(+), 31 deletions(-) (limited to 'haddock-api/src/Haddock/Types.hs') diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index f8d85f88..19630077 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -19,6 +19,8 @@ module Haddock.Convert ( PrintRuntimeReps(..), ) where +#include "HsVersions.h" + import GHC.Data.Bag ( emptyBag ) import GHC.Types.Basic ( TupleSort(..), PromotionFlag(..), DefMethSpec(..), TopLevelFlag(..) ) import GHC.Types.SourceText (SourceText(..)) @@ -45,9 +47,9 @@ import GHC.Builtin.Types ( eqTyConName, listTyConName, liftedTypeKindTyConName import GHC.Builtin.Names ( hasKey, eqTyConKey, ipClassKey, tYPETyConKey , liftedDataConKey, boxedRepDataConKey ) import GHC.Types.Unique ( getUnique ) -import GHC.Utils.Misc ( chkAppend, dropList, equalLength +import GHC.Utils.Misc ( chkAppend, debugIsOn, dropList, equalLength , filterByList, filterOut ) -import GHC.Utils.Panic.Plain ( assert ) +import GHC.Utils.Panic ( assertPanic ) import GHC.Types.Var import GHC.Types.Var.Set import GHC.Types.SrcLoc @@ -931,8 +933,8 @@ tcSplitForAllTysReqPreserveSynonyms :: Type -> ([ReqTVBinder], Type) tcSplitForAllTysReqPreserveSynonyms ty = let (all_bndrs, body) = tcSplitSomeForAllTysPreserveSynonyms isVisibleArgFlag ty req_bndrs = mapMaybe mk_req_bndr_maybe all_bndrs in - assert ( req_bndrs `equalLength` all_bndrs) - (req_bndrs, body) + ASSERT( req_bndrs `equalLength` all_bndrs ) + (req_bndrs, body) where mk_req_bndr_maybe :: TyCoVarBinder -> Maybe ReqTVBinder mk_req_bndr_maybe (Bndr tv argf) = case argf of @@ -944,8 +946,8 @@ tcSplitForAllTysInvisPreserveSynonyms :: Type -> ([InvisTVBinder], Type) tcSplitForAllTysInvisPreserveSynonyms ty = let (all_bndrs, body) = tcSplitSomeForAllTysPreserveSynonyms isInvisibleArgFlag ty inv_bndrs = mapMaybe mk_inv_bndr_maybe all_bndrs in - assert ( inv_bndrs `equalLength` all_bndrs) - (inv_bndrs, body) + ASSERT( inv_bndrs `equalLength` all_bndrs ) + (inv_bndrs, body) where mk_inv_bndr_maybe :: TyCoVarBinder -> Maybe InvisTVBinder mk_inv_bndr_maybe (Bndr tv argf) = case argf of diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 1d6b8bc3..2fc42131 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -338,7 +338,7 @@ reparenTypePrec = go where -- Shorter name for 'reparenType' - go :: XParTy a ~ EpAnn AnnParen => Precedence -> HsType a -> HsType a + go :: XParTy a ~ EpAnn' AnnParen => Precedence -> HsType a -> HsType a go _ (HsBangTy x b ty) = HsBangTy x b (reparenLType ty) go _ (HsTupleTy x con tys) = HsTupleTy x con (map reparenLType tys) go _ (HsSumTy x tys) = HsSumTy x (map reparenLType tys) @@ -378,11 +378,11 @@ reparenTypePrec = go go _ t@XHsType{} = t -- Located variant of 'go' - goL :: XParTy a ~ EpAnn AnnParen => Precedence -> LHsType a -> LHsType a + goL :: XParTy a ~ EpAnn' AnnParen => Precedence -> LHsType a -> LHsType a goL ctxt_prec = mapXRec @a (go ctxt_prec) -- Optionally wrap a type in parens - paren :: XParTy a ~ EpAnn AnnParen + paren :: XParTy a ~ EpAnn' AnnParen => Precedence -- Precedence of context -> Precedence -- Precedence of top-level operator -> HsType a -> HsType a -- Wrap in parens if (ctxt >= op) diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 7c4aeb80..d9943e55 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -727,35 +727,35 @@ type instance Anno (HsOuterTyVarBndrs Specificity DocNameI) = SrcSpanAnnA type instance Anno (HsSigType DocNameI) = SrcSpanAnnA type XRecCond a - = ( XParTy a ~ EpAnn AnnParen + = ( XParTy a ~ EpAnn' AnnParen , NoGhcTc a ~ a , MapXRec a , UnXRec a , WrapXRec a (HsType a) ) -type instance XForAllTy DocNameI = EpAnn [AddEpAnn] -type instance XQualTy DocNameI = EpAnn [AddEpAnn] -type instance XTyVar DocNameI = EpAnn [AddEpAnn] -type instance XStarTy DocNameI = EpAnn [AddEpAnn] -type instance XAppTy DocNameI = EpAnn [AddEpAnn] -type instance XAppKindTy DocNameI = EpAnn [AddEpAnn] -type instance XFunTy DocNameI = EpAnn [AddEpAnn] -type instance XListTy DocNameI = EpAnn AnnParen -type instance XTupleTy DocNameI = EpAnn AnnParen -type instance XSumTy DocNameI = EpAnn AnnParen -type instance XOpTy DocNameI = EpAnn [AddEpAnn] -type instance XParTy DocNameI = EpAnn AnnParen -type instance XIParamTy DocNameI = EpAnn [AddEpAnn] -type instance XKindSig DocNameI = EpAnn [AddEpAnn] +type instance XForAllTy DocNameI = EpAnn +type instance XQualTy DocNameI = EpAnn +type instance XTyVar DocNameI = EpAnn +type instance XStarTy DocNameI = EpAnn +type instance XAppTy DocNameI = EpAnn +type instance XAppKindTy DocNameI = EpAnn +type instance XFunTy DocNameI = EpAnn +type instance XListTy DocNameI = EpAnn' AnnParen +type instance XTupleTy DocNameI = EpAnn' AnnParen +type instance XSumTy DocNameI = EpAnn' AnnParen +type instance XOpTy DocNameI = EpAnn +type instance XParTy DocNameI = EpAnn' AnnParen +type instance XIParamTy DocNameI = EpAnn +type instance XKindSig DocNameI = EpAnn type instance XSpliceTy DocNameI = Void -- see `renameHsSpliceTy` -type instance XDocTy DocNameI = EpAnn [AddEpAnn] -type instance XBangTy DocNameI = EpAnn [AddEpAnn] -type instance XRecTy DocNameI = EpAnn [AddEpAnn] -type instance XExplicitListTy DocNameI = EpAnn [AddEpAnn] -type instance XExplicitTupleTy DocNameI = EpAnn [AddEpAnn] -type instance XTyLit DocNameI = EpAnn [AddEpAnn] -type instance XWildCardTy DocNameI = EpAnn [AddEpAnn] +type instance XDocTy DocNameI = EpAnn +type instance XBangTy DocNameI = EpAnn +type instance XRecTy DocNameI = EpAnn +type instance XExplicitListTy DocNameI = EpAnn +type instance XExplicitTupleTy DocNameI = EpAnn +type instance XTyLit DocNameI = EpAnn +type instance XWildCardTy DocNameI = EpAnn type instance XXType DocNameI = HsCoreTy type instance XHsForAllVis DocNameI = NoExtField -- cgit v1.2.3 From 07663b5e69b038b811d213701cba322e90e6f212 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Thu, 15 Apr 2021 20:57:21 +0100 Subject: Update for EPA changes in GHC --- haddock-api/src/Haddock/GhcUtils.hs | 6 ++--- haddock-api/src/Haddock/Types.hs | 44 ++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 25 deletions(-) (limited to 'haddock-api/src/Haddock/Types.hs') diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 2fc42131..1d6b8bc3 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -338,7 +338,7 @@ reparenTypePrec = go where -- Shorter name for 'reparenType' - go :: XParTy a ~ EpAnn' AnnParen => Precedence -> HsType a -> HsType a + go :: XParTy a ~ EpAnn AnnParen => Precedence -> HsType a -> HsType a go _ (HsBangTy x b ty) = HsBangTy x b (reparenLType ty) go _ (HsTupleTy x con tys) = HsTupleTy x con (map reparenLType tys) go _ (HsSumTy x tys) = HsSumTy x (map reparenLType tys) @@ -378,11 +378,11 @@ reparenTypePrec = go go _ t@XHsType{} = t -- Located variant of 'go' - goL :: XParTy a ~ EpAnn' AnnParen => Precedence -> LHsType a -> LHsType a + goL :: XParTy a ~ EpAnn AnnParen => Precedence -> LHsType a -> LHsType a goL ctxt_prec = mapXRec @a (go ctxt_prec) -- Optionally wrap a type in parens - paren :: XParTy a ~ EpAnn' AnnParen + paren :: XParTy a ~ EpAnn AnnParen => Precedence -- Precedence of context -> Precedence -- Precedence of top-level operator -> HsType a -> HsType a -- Wrap in parens if (ctxt >= op) diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index d9943e55..7c4aeb80 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -727,35 +727,35 @@ type instance Anno (HsOuterTyVarBndrs Specificity DocNameI) = SrcSpanAnnA type instance Anno (HsSigType DocNameI) = SrcSpanAnnA type XRecCond a - = ( XParTy a ~ EpAnn' AnnParen + = ( XParTy a ~ EpAnn AnnParen , NoGhcTc a ~ a , MapXRec a , UnXRec a , WrapXRec a (HsType a) ) -type instance XForAllTy DocNameI = EpAnn -type instance XQualTy DocNameI = EpAnn -type instance XTyVar DocNameI = EpAnn -type instance XStarTy DocNameI = EpAnn -type instance XAppTy DocNameI = EpAnn -type instance XAppKindTy DocNameI = EpAnn -type instance XFunTy DocNameI = EpAnn -type instance XListTy DocNameI = EpAnn' AnnParen -type instance XTupleTy DocNameI = EpAnn' AnnParen -type instance XSumTy DocNameI = EpAnn' AnnParen -type instance XOpTy DocNameI = EpAnn -type instance XParTy DocNameI = EpAnn' AnnParen -type instance XIParamTy DocNameI = EpAnn -type instance XKindSig DocNameI = EpAnn +type instance XForAllTy DocNameI = EpAnn [AddEpAnn] +type instance XQualTy DocNameI = EpAnn [AddEpAnn] +type instance XTyVar DocNameI = EpAnn [AddEpAnn] +type instance XStarTy DocNameI = EpAnn [AddEpAnn] +type instance XAppTy DocNameI = EpAnn [AddEpAnn] +type instance XAppKindTy DocNameI = EpAnn [AddEpAnn] +type instance XFunTy DocNameI = EpAnn [AddEpAnn] +type instance XListTy DocNameI = EpAnn AnnParen +type instance XTupleTy DocNameI = EpAnn AnnParen +type instance XSumTy DocNameI = EpAnn AnnParen +type instance XOpTy DocNameI = EpAnn [AddEpAnn] +type instance XParTy DocNameI = EpAnn AnnParen +type instance XIParamTy DocNameI = EpAnn [AddEpAnn] +type instance XKindSig DocNameI = EpAnn [AddEpAnn] type instance XSpliceTy DocNameI = Void -- see `renameHsSpliceTy` -type instance XDocTy DocNameI = EpAnn -type instance XBangTy DocNameI = EpAnn -type instance XRecTy DocNameI = EpAnn -type instance XExplicitListTy DocNameI = EpAnn -type instance XExplicitTupleTy DocNameI = EpAnn -type instance XTyLit DocNameI = EpAnn -type instance XWildCardTy DocNameI = EpAnn +type instance XDocTy DocNameI = EpAnn [AddEpAnn] +type instance XBangTy DocNameI = EpAnn [AddEpAnn] +type instance XRecTy DocNameI = EpAnn [AddEpAnn] +type instance XExplicitListTy DocNameI = EpAnn [AddEpAnn] +type instance XExplicitTupleTy DocNameI = EpAnn [AddEpAnn] +type instance XTyLit DocNameI = EpAnn [AddEpAnn] +type instance XWildCardTy DocNameI = EpAnn [AddEpAnn] type instance XXType DocNameI = HsCoreTy type instance XHsForAllVis DocNameI = NoExtField -- cgit v1.2.3 From 1ef24e617651955f07c4fb6f2d488806cc6785ec Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Thu, 28 Oct 2021 18:57:10 +0100 Subject: Update for changes in GHC for branch wip/az/no-srcspan-anno-instances --- haddock-api/src/Haddock/Convert.hs | 12 ++++++------ haddock-api/src/Haddock/Interface/Create.hs | 4 ++-- haddock-api/src/Haddock/Types.hs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'haddock-api/src/Haddock/Types.hs') diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index cf533c20..29e0957b 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -341,14 +341,14 @@ synifyInjectivityAnn Nothing _ _ = Nothing synifyInjectivityAnn _ _ NotInjective = Nothing synifyInjectivityAnn (Just lhs) tvs (Injective inj) = let rhs = map (noLocA . tyVarName) (filterByList inj tvs) - in Just $ noLoc $ InjectivityAnn noAnn (noLocA lhs) rhs + in Just $ noLocA $ InjectivityAnn noAnn (noLocA lhs) rhs synifyFamilyResultSig :: Maybe Name -> Kind -> LFamilyResultSig GhcRn synifyFamilyResultSig Nothing kind - | isLiftedTypeKind kind = noLoc $ NoSig noExtField - | otherwise = noLoc $ KindSig noExtField (synifyKindSig kind) + | isLiftedTypeKind kind = noLocA $ NoSig noExtField + | otherwise = noLocA $ KindSig noExtField (synifyKindSig kind) synifyFamilyResultSig (Just name) kind = - noLoc $ TyVarSig noExtField (noLocA $ KindedTyVar noAnn () (noLocA name) (synifyKindSig kind)) + noLocA $ TyVarSig noExtField (noLocA $ KindedTyVar noAnn () (noLocA name) (synifyKindSig kind)) -- User beware: it is your responsibility to pass True (use_gadt_syntax) -- for any constructor that would be misrepresented by omitting its @@ -387,7 +387,7 @@ synifyDataCon use_gadt_syntax dc = field_tys = zipWith con_decl_field (dataConFieldLabels dc) linear_tys con_decl_field fl synTy = noLocA $ - ConDeclField noAnn [noLoc $ FieldOcc (flSelector fl) (noLocA $ mkVarUnqual $ flLabel fl)] synTy + ConDeclField noAnn [noLocA $ FieldOcc (flSelector fl) (noLocA $ mkVarUnqual $ flLabel fl)] synTy Nothing mk_h98_arg_tys :: Either ErrMsg (HsConDeclH98Details GhcRn) @@ -611,7 +611,7 @@ synifyType _ vs (TyConApp tc tys) | tc `hasKey` ipClassKey , [name, ty] <- tys , Just x <- isStrLitTy name - = noLocA $ HsIParamTy noAnn (noLoc $ HsIPName x) (synifyType WithinType vs ty) + = noLocA $ HsIParamTy noAnn (noLocA $ HsIPName x) (synifyType WithinType vs ty) -- and equalities | tc `hasKey` eqTyConKey , [ty1, ty2] <- tys diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 75789a06..4d746405 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -1170,8 +1170,8 @@ extractRecSel nm t tvs (L _ con : rest) = _ -> extractRecSel nm t tvs rest where matching_fields :: [LConDeclField GhcRn] -> [(SrcSpan, LConDeclField GhcRn)] - matching_fields flds = [ (l,f) | f@(L _ (ConDeclField _ ns _ _)) <- flds - , L l n <- ns, foExt n == nm ] + matching_fields flds = [ (locA l,f) | f@(L _ (ConDeclField _ ns _ _)) <- flds + , L l n <- ns, foExt n == nm ] data_ty -- ResTyGADT _ ty <- con_res con = ty | ConDeclGADT{} <- con = con_res_ty con diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 7c4aeb80..05375185 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -709,8 +709,8 @@ type instance Anno (HsTyVarBndr flag DocNameI) = SrcSpanAnnA type instance Anno [LocatedA (HsType DocNameI)] = SrcSpanAnnC type instance Anno (HsType DocNameI) = SrcSpanAnnA type instance Anno (DataFamInstDecl DocNameI) = SrcSpanAnnA -type instance Anno (DerivStrategy DocNameI) = SrcSpan -type instance Anno (FieldOcc DocNameI) = SrcSpan +type instance Anno (DerivStrategy DocNameI) = SrcAnn NoEpAnns +type instance Anno (FieldOcc DocNameI) = SrcAnn NoEpAnns type instance Anno (ConDeclField DocNameI) = SrcSpan type instance Anno (Located (ConDeclField DocNameI)) = SrcSpan type instance Anno [Located (ConDeclField DocNameI)] = SrcSpan @@ -720,9 +720,9 @@ type instance Anno (TyFamInstDecl DocNameI) = SrcSpanAnnA type instance Anno [LocatedA (TyFamInstDecl DocNameI)] = SrcSpanAnnL type instance Anno (FamilyDecl DocNameI) = SrcSpan type instance Anno (Sig DocNameI) = SrcSpan -type instance Anno (InjectivityAnn DocNameI) = SrcSpan +type instance Anno (InjectivityAnn DocNameI) = SrcAnn NoEpAnns type instance Anno (HsDecl DocNameI) = SrcSpanAnnA -type instance Anno (FamilyResultSig DocNameI) = SrcSpan +type instance Anno (FamilyResultSig DocNameI) = SrcAnn NoEpAnns type instance Anno (HsOuterTyVarBndrs Specificity DocNameI) = SrcSpanAnnA type instance Anno (HsSigType DocNameI) = SrcSpanAnnA -- cgit v1.2.3 From 8a73a5babd07530326f1ba06bdfe95f49f66b967 Mon Sep 17 00:00:00 2001 From: Krzysztof Gogolewski Date: Sat, 27 Nov 2021 02:42:35 +0100 Subject: Update after NoExtCon -> DataConCantHappen rename --- haddock-api/src/Haddock/GhcUtils.hs | 2 +- haddock-api/src/Haddock/Types.hs | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'haddock-api/src/Haddock/Types.hs') diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 599404a0..85e6fcf4 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -114,7 +114,7 @@ pretty = showPpr -- instantiated at DocNameI instead of (GhcPass _). -- | Like 'hsTyVarName' from GHC API, but not instantiated at (GhcPass _) -hsTyVarBndrName :: forall flag n. (XXTyVarBndr n ~ NoExtCon, UnXRec n) +hsTyVarBndrName :: forall flag n. (XXTyVarBndr n ~ DataConCantHappen, UnXRec n) => HsTyVarBndr flag n -> IdP n hsTyVarBndrName (UserTyVar _ _ name) = unXRec @n name hsTyVarBndrName (KindedTyVar _ _ name _) = unXRec @n name diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 05375185..30f583b0 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -319,7 +319,7 @@ type instance NoGhcTc DocNameI = DocNameI type instance IdP DocNameI = DocName instance CollectPass DocNameI where - collectXXPat _ _ ext = noExtCon ext + collectXXPat _ _ ext = dataConCantHappen ext instance NamedThing DocName where getName (Documented name _) = name @@ -760,11 +760,11 @@ type instance XXType DocNameI = HsCoreTy type instance XHsForAllVis DocNameI = NoExtField type instance XHsForAllInvis DocNameI = NoExtField -type instance XXHsForAllTelescope DocNameI = NoExtCon +type instance XXHsForAllTelescope DocNameI = DataConCantHappen type instance XUserTyVar DocNameI = NoExtField type instance XKindedTyVar DocNameI = NoExtField -type instance XXTyVarBndr DocNameI = NoExtCon +type instance XXTyVarBndr DocNameI = DataConCantHappen type instance XCFieldOcc DocNameI = DocName type instance XXFieldOcc DocNameI = NoExtField @@ -780,7 +780,7 @@ type instance XForeignExport DocNameI = NoExtField type instance XForeignImport DocNameI = NoExtField type instance XConDeclGADT DocNameI = NoExtField type instance XConDeclH98 DocNameI = NoExtField -type instance XXConDecl DocNameI = NoExtCon +type instance XXConDecl DocNameI = DataConCantHappen type instance XDerivD DocNameI = NoExtField type instance XInstD DocNameI = NoExtField @@ -791,10 +791,10 @@ type instance XTyClD DocNameI = NoExtField type instance XNoSig DocNameI = NoExtField type instance XCKindSig DocNameI = NoExtField type instance XTyVarSig DocNameI = NoExtField -type instance XXFamilyResultSig DocNameI = NoExtCon +type instance XXFamilyResultSig DocNameI = DataConCantHappen type instance XCFamEqn DocNameI _ = NoExtField -type instance XXFamEqn DocNameI _ = NoExtCon +type instance XXFamEqn DocNameI _ = DataConCantHappen type instance XCClsInstDecl DocNameI = NoExtField type instance XCDerivDecl DocNameI = NoExtField @@ -811,23 +811,23 @@ type instance XClassDecl DocNameI = NoExtField type instance XDataDecl DocNameI = NoExtField type instance XSynDecl DocNameI = NoExtField type instance XFamDecl DocNameI = NoExtField -type instance XXFamilyDecl DocNameI = NoExtCon -type instance XXTyClDecl DocNameI = NoExtCon +type instance XXFamilyDecl DocNameI = DataConCantHappen +type instance XXTyClDecl DocNameI = DataConCantHappen type instance XHsWC DocNameI _ = NoExtField type instance XHsOuterExplicit DocNameI _ = NoExtField type instance XHsOuterImplicit DocNameI = NoExtField -type instance XXHsOuterTyVarBndrs DocNameI = NoExtCon +type instance XXHsOuterTyVarBndrs DocNameI = DataConCantHappen type instance XHsSig DocNameI = NoExtField -type instance XXHsSigType DocNameI = NoExtCon +type instance XXHsSigType DocNameI = DataConCantHappen type instance XHsQTvs DocNameI = NoExtField type instance XConDeclField DocNameI = NoExtField -type instance XXConDeclField DocNameI = NoExtCon +type instance XXConDeclField DocNameI = DataConCantHappen -type instance XXPat DocNameI = NoExtCon +type instance XXPat DocNameI = DataConCantHappen type instance XCInjectivityAnn DocNameI = NoExtField -- cgit v1.2.3 From e057bfc880d98fe872e3ee9291d2ee1cd3ceeccd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 11 Jan 2021 01:06:40 +0000 Subject: Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) --- haddock-api/src/Haddock/Types.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'haddock-api/src/Haddock/Types.hs') diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 30f583b0..ba86f429 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -319,7 +319,8 @@ type instance NoGhcTc DocNameI = DocNameI type instance IdP DocNameI = DocName instance CollectPass DocNameI where - collectXXPat _ _ ext = dataConCantHappen ext + collectXXPat _ ext = dataConCantHappen ext + collectXXHsBindsLR ext = dataConCantHappen ext instance NamedThing DocName where getName (Documented name _) = name @@ -828,6 +829,7 @@ type instance XConDeclField DocNameI = NoExtField type instance XXConDeclField DocNameI = DataConCantHappen type instance XXPat DocNameI = DataConCantHappen +type instance XXHsBindsLR DocNameI a = DataConCantHappen type instance XCInjectivityAnn DocNameI = NoExtField -- cgit v1.2.3 From b02188ab1cc46dd82395a22b04f890cf15f3feae Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Sun, 18 Oct 2020 16:25:35 +0300 Subject: Link to (~) --- haddock-api/src/Haddock/GhcUtils.hs | 1 + haddock-api/src/Haddock/Types.hs | 1 + haddock-library/src/Documentation/Haddock/Parser/Monad.hs | 1 + html-test/ref/FunArgs.html | 4 +++- html-test/ref/TypeOperators.html | 10 ++++++++-- 5 files changed, 14 insertions(+), 3 deletions(-) (limited to 'haddock-api/src/Haddock/Types.hs') diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 85e6fcf4..3f97236a 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -1,5 +1,6 @@ {-# LANGUAGE BangPatterns, StandaloneDeriving, FlexibleInstances, ViewPatterns #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index ba86f429..7d00c5ec 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -1,4 +1,5 @@ {-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving, TypeFamilies, RecordWildCards #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PartialTypeSignatures #-} diff --git a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs index 7c73a168..2fa79961 100644 --- a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs +++ b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE TypeSynonymInstances #-} -- | diff --git a/html-test/ref/FunArgs.html b/html-test/ref/FunArgs.html index 2fac6d4e..855f1b89 100644 --- a/html-test/ref/FunArgs.html +++ b/html-test/ref/FunArgs.html @@ -230,7 +230,9 @@ >:: forall a (b :: ()) d. d ~ ' a (b :: ()) d. d ~ '()

f :: a ~ b => a -> b :: a ~ b => a -> b #

g :: (a ~ b, b ~ c) => a -> c :: (a ~ b, b ~ c) => a -> c #