Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
EPA : Rename ApiAnn to EpAnn
Browse files Browse the repository at this point in the history
  • Loading branch information
alanz authored and bgamari committed Mar 29, 2021
1 parent c1bb76d commit 4411b41
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
6 changes: 3 additions & 3 deletions haddock-api/src/Haddock/GhcUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ reparenTypePrec = go
where

-- Shorter name for 'reparenType'
go :: XParTy a ~ ApiAnn' 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)
Expand Down Expand Up @@ -378,11 +378,11 @@ reparenTypePrec = go
go _ t@XHsType{} = t

-- Located variant of 'go'
goL :: XParTy a ~ ApiAnn' 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 ~ ApiAnn' 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)
Expand Down
47 changes: 22 additions & 25 deletions haddock-api/src/Haddock/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4411b41

Please sign in to comment.