[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: EPA: Remove redundant code
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Mon May 20 12:05:28 UTC 2024
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00
EPA: Remove redundant code
Remove unused
epAnnAnns function
various cases for showAstData that no longer exist
- - - - -
ab51526f by Rodrigo Mesquita at 2024-05-20T08:05:09-04:00
Improve docs on closed type families in hs-boots
Fixes #24776
- - - - -
cd5bf170 by Torsten Schmits at 2024-05-20T08:05:10-04:00
Use default deviation for large-project test
This new performance test has the purpose of detecting regressions in
complexity in relation to the number of modules in a project, so 1%
deviation is way too small to avoid false positives.
- - - - -
5 changed files:
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Parser/Annotation.hs
- docs/users_guide/exts/type_families.rst
- docs/users_guide/separate_compilation.rst
- testsuite/tests/perf/compiler/large-project/all.T
Changes:
=====================================
compiler/GHC/Hs/Dump.hs
=====================================
@@ -59,16 +59,10 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0
`ext1Q` list
`extQ` list_addEpAnn
`extQ` string `extQ` fastString `extQ` srcSpan `extQ` realSrcSpan
- `extQ` annotation
`extQ` annotationModule
- `extQ` annotationAddEpAnn
`extQ` annotationGrhsAnn
- `extQ` annotationEpAnnHsCase
`extQ` annotationAnnList
`extQ` annotationEpAnnImportDecl
- `extQ` annotationAnnParen
- `extQ` annotationTrailingAnn
- `extQ` annotationEpaLocation
`extQ` annotationNoEpAnns
`extQ` addEpAnn
`extQ` annParen
@@ -235,36 +229,18 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0
-- -------------------------
- annotation :: EpAnn [AddEpAnn] -> SDoc
- annotation = annotation' (text "EpAnn [AddEpAnn]")
-
annotationModule :: EpAnn AnnsModule -> SDoc
annotationModule = annotation' (text "EpAnn AnnsModule")
- annotationAddEpAnn :: EpAnn AddEpAnn -> SDoc
- annotationAddEpAnn = annotation' (text "EpAnn AddEpAnn")
-
annotationGrhsAnn :: EpAnn GrhsAnn -> SDoc
annotationGrhsAnn = annotation' (text "EpAnn GrhsAnn")
- annotationEpAnnHsCase :: EpAnn EpAnnHsCase -> SDoc
- annotationEpAnnHsCase = annotation' (text "EpAnn EpAnnHsCase")
-
annotationAnnList :: EpAnn AnnList -> SDoc
annotationAnnList = annotation' (text "EpAnn AnnList")
annotationEpAnnImportDecl :: EpAnn EpAnnImportDecl -> SDoc
annotationEpAnnImportDecl = annotation' (text "EpAnn EpAnnImportDecl")
- annotationAnnParen :: EpAnn AnnParen -> SDoc
- annotationAnnParen = annotation' (text "EpAnn AnnParen")
-
- annotationTrailingAnn :: EpAnn TrailingAnn -> SDoc
- annotationTrailingAnn = annotation' (text "EpAnn TrailingAnn")
-
- annotationEpaLocation :: EpAnn EpaLocation -> SDoc
- annotationEpaLocation = annotation' (text "EpAnn EpaLocation")
-
annotationNoEpAnns :: EpAnn NoEpAnns -> SDoc
annotationNoEpAnns = annotation' (text "EpAnn NoEpAnns")
=====================================
compiler/GHC/Parser/Annotation.hs
=====================================
@@ -70,7 +70,6 @@ module GHC.Parser.Annotation (
-- ** Querying annotations
getLocAnn,
- epAnnAnns,
annParen2AddEpAnn,
epAnnComments,
@@ -1139,9 +1138,6 @@ widenLocatedAn (EpAnn (EpaSpan l) a cs) as = EpAnn (spanAsAnchor l') a cs
l' = widenSpan l as
widenLocatedAn (EpAnn anc a cs) _as = EpAnn anc a cs
-epAnnAnns :: EpAnn [AddEpAnn] -> [AddEpAnn]
-epAnnAnns (EpAnn _ anns _) = anns
-
annParen2AddEpAnn :: AnnParen -> [AddEpAnn]
annParen2AddEpAnn (AnnParen pt o c)
= [AddEpAnn ai o, AddEpAnn ac c]
=====================================
docs/users_guide/exts/type_families.rst
=====================================
@@ -415,10 +415,19 @@ left hand side of an equation can be explicitly bound, such as in: ::
A closed type family may be declared with no equations. Such closed type
families are opaque type-level definitions that will never reduce, are
not necessarily injective (unlike empty data types), and cannot be given
-any instances. This is different from omitting the equations of a closed
-type family in a ``hs-boot`` file, which uses the syntax ``where ..``,
-as in that case there may or may not be equations given in the ``hs``
-file.
+any instances.
+
+In an ``hs-boot`` file, closed type families must either have the same
+equations as those in the source file, or you can use the following syntax to
+omit the equations (note the literal ``..``) ::
+
+ type family R a where ..
+
+In this case, the closed type family ``R`` matching this "boot" declaration may
+have any number of equations given in the source ``hs`` file (including zero).
+For more information on mutual recursive modules with ``hs-boot`` modules
+(including type families) see :ref:`mutual-recursion`.
+
.. _type-family-examples:
=====================================
docs/users_guide/separate_compilation.rst
=====================================
@@ -729,8 +729,8 @@ be recompiled.
.. _mutual-recursion:
-How to compile mutually recursive modules
------------------------------------------
+Mutually recursive modules and hs-boot files
+--------------------------------------------
.. index::
single: module system, recursion
@@ -851,8 +851,9 @@ A hs-boot file is written in a subset of Haskell:
- Open type and data family declarations are exactly as in Haskell.
-- A closed type family may optionally omit its equations, as in the
- following example: ::
+- A closed type family may either be given in full (where all equations must
+ match the source module), or it can be given abstractly using the ``where ..``
+ syntax (thus omitting the equations), as in the following example: ::
type family ClosedFam a where ..
=====================================
testsuite/tests/perf/compiler/large-project/all.T
=====================================
@@ -7,7 +7,7 @@ def large_project_makedepend(num):
return test(
f'large-project-makedepend-{num}',
[
- collect_compiler_stats('bytes allocated', 1),
+ collect_compiler_stats('bytes allocated'),
pre_cmd(f'./large-project.sh {num}'),
extra_files(['large-project.sh']),
ignore_stderr,
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bd7105642c2b8ef401a3f4bb0a8e540c4cf2053c...cd5bf17048600742124199385b770a99dc946f90
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bd7105642c2b8ef401a3f4bb0a8e540c4cf2053c...cd5bf17048600742124199385b770a99dc946f90
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240520/3516dd6d/attachment-0001.html>
More information about the ghc-commits
mailing list