ghc-boot-th 9.12.4 → 9.14.1
raw patch · 2 files changed
+48/−47 lines, 2 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ GHC.Boot.TH.Ppr: ppr_tm_forall :: Maybe [TyVarBndr ()] -> [RuleBndr] -> Doc
+ GHC.Boot.TH.Ppr: ppr_ty_forall :: Maybe [TyVarBndr ()] -> Doc
+ GHC.LanguageExtensions.Type: ExplicitLevelImports :: Extension
+ GHC.LanguageExtensions.Type: ImplicitStagePersistence :: Extension
Files
- GHC/Boot/TH/Ppr.hs +42/−42
- ghc-boot-th.cabal +6/−5
GHC/Boot/TH/Ppr.hs view
@@ -398,7 +398,8 @@ <+> braces (sep $ punctuate comma $ map (\(s,p) -> pprName' Applied s <+> equals <+> ppr p) fs) pprPat _ (ListP ps) = brackets (commaSep ps)-pprPat i (SigP p t) = parensIf (i > noPrec) $ ppr p <+> dcolon <+> ppr t+pprPat i (SigP p t) = parensIf (i > noPrec) $ pprPat sigPrec p+ <+> dcolon <+> pprType sigPrec t pprPat _ (ViewP e p) = parens $ pprExp noPrec e <+> text "->" <+> pprPat noPrec p pprPat _ (TypeP t) = parens $ text "type" <+> ppr t pprPat _ (InvisP t) = parens $ text "@" <+> ppr t@@ -645,28 +646,20 @@ <+> text "#-}" ppr (OpaqueP n) = text "{-# OPAQUE" <+> pprName' Applied n <+> text "#-}"- ppr (SpecialiseP n ty inline phases)- = text "{-# SPECIALISE"- <+> maybe empty ppr inline- <+> ppr phases- <+> sep [ pprName' Applied n <+> dcolon- , nest 2 $ ppr ty ]- <+> text "#-}"+ ppr (SpecialiseEP ty_bndrs tm_bndrs spec_e inline phases)+ = sep [ text "{-# SPECIALISE"+ <+> maybe empty ppr inline+ <+> ppr phases+ , nest 2 $ sep [ ppr_ty_forall ty_bndrs <+> ppr_tm_forall ty_bndrs tm_bndrs+ , nest 2 (ppr spec_e) ]+ <+> text "#-}" ] ppr (SpecialiseInstP inst) = text "{-# SPECIALISE instance" <+> ppr inst <+> text "#-}" ppr (RuleP n ty_bndrs tm_bndrs lhs rhs phases) = sep [ text "{-# RULES" <+> pprString n <+> ppr phases- , nest 4 $ ppr_ty_forall ty_bndrs <+> ppr_tm_forall ty_bndrs+ , nest 4 $ ppr_ty_forall ty_bndrs <+> ppr_tm_forall ty_bndrs tm_bndrs <+> ppr lhs , nest 4 $ char '=' <+> ppr rhs <+> text "#-}" ]- where ppr_ty_forall Nothing = empty- ppr_ty_forall (Just bndrs) = text "forall"- <+> fsep (map ppr bndrs)- <+> char '.'- ppr_tm_forall Nothing | null tm_bndrs = empty- ppr_tm_forall _ = text "forall"- <+> fsep (map ppr tm_bndrs)- <+> char '.' ppr (AnnP tgt expr) = text "{-# ANN" <+> target1 tgt <+> ppr expr <+> text "#-}" where target1 ModuleAnnotation = text "module"@@ -680,6 +673,17 @@ ppr (SCCP nm str) = text "{-# SCC" <+> pprName' Applied nm <+> maybe empty pprString str <+> text "#-}" +ppr_ty_forall :: Maybe [TyVarBndr ()] -> Doc+ppr_ty_forall Nothing = empty+ppr_ty_forall (Just bndrs) = text "forall"+ <+> fsep (map ppr bndrs)+ <+> char '.'++ppr_tm_forall :: Maybe [TyVarBndr ()] -> [RuleBndr] -> Doc+ppr_tm_forall Nothing [] = empty+ppr_tm_forall _ tm_bndrs = text "forall"+ <+> fsep (map ppr tm_bndrs)+ <+> char '.' ------------------------------ instance Ppr Inline where ppr NoInline = text "NOINLINE"@@ -708,31 +712,27 @@ ------------------------------ instance Ppr Con where- ppr (NormalC c sts) = pprName' Applied c <+> sep (map pprBangType sts)-- ppr (RecC c vsts)- = pprName' Applied c <+> braces (sep (punctuate comma $ map pprVarBangType vsts))-- ppr (InfixC st1 c st2) = pprBangType st1- <+> pprName' Infix c- <+> pprBangType st2-- ppr (ForallC ns ctxt (GadtC cs sts ty))- = commaSepApplied cs <+> dcolon <+> pprForall ns ctxt- <+> pprGadtRHS sts ty-- ppr (ForallC ns ctxt (RecGadtC cs vsts ty))- = commaSepApplied cs <+> dcolon <+> pprForall ns ctxt- <+> pprRecFields vsts ty-- ppr (ForallC ns ctxt con)- = pprForall ns ctxt <+> ppr con-- ppr (GadtC cs sts ty)- = commaSepApplied cs <+> dcolon <+> pprGadtRHS sts ty-- ppr (RecGadtC cs vsts ty)- = commaSepApplied cs <+> dcolon <+> pprRecFields vsts ty+ ppr = ppr_con id+ where+ ppr_con :: (Doc -> Doc) -> Con -> Doc+ ppr_con ppr_foralls (NormalC c sts) =+ ppr_foralls $ pprName' Applied c <+> sep (map pprBangType sts)+ ppr_con ppr_foralls (RecC c vsts) =+ ppr_foralls $ pprName' Applied c <+> ppr_rec vsts+ where+ ppr_rec :: [VarBangType] -> Doc+ ppr_rec = braces . sep . punctuate comma . map pprVarBangType+ ppr_con ppr_foralls (InfixC st1 c st2) =+ ppr_foralls $+ pprBangType st1+ <+> pprName' Infix c+ <+> pprBangType st2+ ppr_con ppr_foralls (ForallC ns ctxt con)+ = ppr_con (\d -> ppr_foralls $ sep [pprForall ns ctxt, d]) con+ ppr_con ppr_foralls (GadtC cs sts ty)+ = commaSepApplied cs <+> dcolon <+> ppr_foralls (pprGadtRHS sts ty)+ ppr_con ppr_foralls (RecGadtC cs vsts ty)+ = commaSepApplied cs <+> dcolon <+> ppr_foralls (pprRecFields vsts ty) instance Ppr PatSynDir where ppr Unidir = text "<-"
ghc-boot-th.cabal view
@@ -3,7 +3,7 @@ -- ghc-boot-th.cabal.in, not ghc-boot-th.cabal. name: ghc-boot-th-version: 9.12.4+version: 9.14.1 license: BSD3 license-file: LICENSE category: GHC@@ -29,7 +29,7 @@ Flag bootstrap Description: Enabled when building the stage1 compiler in order to vendor the in-tree- `ghc-boot-th` library, and through that the in-tree TH AST defintions from+ `ghc-boot-th` library, and through that the in-tree TH AST definitions from `ghc-internal`. See Note [Bootstrapping Template Haskell] Default: False@@ -49,12 +49,13 @@ GHC.Lexeme build-depends:- base >= 4.7 && < 4.22,- ghc-prim,- pretty == 1.1.*+ base >= 4.7 && < 4.23,+ pretty == 1.1.* if flag(bootstrap) cpp-options: -DBOOTSTRAP_TH+ build-depends:+ ghc-prim hs-source-dirs: . exposed-modules: GHC.Boot.TH.Lib