[Git][ghc/ghc][wip/az/locateda-epa-improve-2023-07-15] 72 commits: Remove ScopedTypeVariables => TypeAbstractions

Alan Zimmerman (@alanz) gitlab at gitlab.haskell.org
Tue Sep 5 21:57:01 UTC 2023



Alan Zimmerman pushed to branch wip/az/locateda-epa-improve-2023-07-15 at Glasgow Haskell Compiler / GHC


Commits:
9eecdf33 by sheaf at 2023-08-28T18:54:06+00:00
Remove ScopedTypeVariables => TypeAbstractions

This commit implements [amendment 604](https://github.com/ghc-proposals/ghc-proposals/pull/604/)
to [GHC proposal 448](https://github.com/ghc-proposals/ghc-proposals/pull/448)
by removing the implication of language extensions

  ScopedTypeVariables => TypeAbstractions

To limit breakage, we now allow type arguments in constructor patterns
when both ScopedTypeVariables and TypeApplications are enabled, but
we emit a warning notifying the user that this is deprecated behaviour
that will go away starting in GHC 9.12.

Fixes #23776

- - - - -
fadd5b4d by sheaf at 2023-08-28T18:54:06+00:00
.stderr: ScopedTypeVariables =/> TypeAbstractions

This commit accepts testsuite changes for the changes in the previous
commit, which mean that TypeAbstractions is no longer implied by
ScopedTypeVariables.

- - - - -
4f5fb500 by Greg Steuck at 2023-08-29T07:55:13-04:00
Repair `codes` test on OpenBSD by explicitly requesting extended RE

- - - - -
6bbde581 by Vasily Sterekhov at 2023-08-29T12:06:58-04:00
Add test for #23540

`T23540.hs` makes use of `explainEv` from `HieQueries.hs`, so
`explainEv` has been moved to `TestUtils.hs`.

- - - - -
257bb3bd by Vasily Sterekhov at 2023-08-29T12:06:58-04:00
Add test for #23120

- - - - -
4f192947 by Vasily Sterekhov at 2023-08-29T12:06:58-04:00
Make some evidence uses reachable by toHie

Resolves #23540, #23120

This adds spans to certain expressions in the typechecker and renamer,
and lets 'toHie' make use of those spans. Therefore the relevant
evidence uses for the following syntax will now show up under the
expected nodes in 'HieAst's:

- Overloaded literals ('IsString', 'Num', 'Fractional')

- Natural patterns and N+k patterns ('Eq', 'Ord', and instances from the
  overloaded literals being matched on)

- Arithmetic sequences ('Enum')

- Monadic bind statements ('Monad')

- Monadic body statements ('Monad', 'Alternative')

- ApplicativeDo ('Applicative', 'Functor')

- Overloaded lists ('IsList')

Also see Note [Source locations for implicit function calls]

In the process of handling overloaded lists I added an extra 'SrcSpan'
field to 'VAExpansion' - this allows us to more accurately reconstruct
the locations from the renamer in 'rebuildHsApps'. This also happens to
fix #23120.

See the additions to Note [Looking through HsExpanded]

- - - - -
fe9fcf9d by Sylvain Henry at 2023-08-29T12:07:50-04:00
ghc-heap: rename C file (fix #23898)

- - - - -
b60d6576 by Krzysztof Gogolewski at 2023-08-29T12:08:29-04:00
Misc cleanup

- Builtin.PrimOps: ReturnsAlg was used only for unboxed tuples.
  Rename to ReturnsTuple.
- Builtin.Utils: use SDoc for a panic message.
  The comment about <<details unavailable>> was obsoleted by e8d356773b56.
- TagCheck: fix wrong logic. It was zipping a list 'args' with its
  version 'args_cmm' after filtering.
- Core.Type: remove an outdated 1999 comment about unlifted polymorphic types
- hadrian: remove leftover debugging print

- - - - -
3054fd6d by Krzysztof Gogolewski at 2023-08-29T12:09:08-04:00
Add a regression test for #23903

The bug has been fixed by commit bad2f8b8aa8424.

- - - - -
21584b12 by Ben Gamari at 2023-08-29T19:52:02-04:00
README: Refer to ghc-hq repository for contributor and governance information

- - - - -
e542d590 by sheaf at 2023-08-29T19:52:40-04:00
Export setInertSet from GHC.Tc.Solver.Monad

We used to export getTcSInerts and setTcSInerts from GHC.Tc.Solver.Monad.
These got renamed to getInertSet/setInertSet in e1590ddc. That commit also removed
the export of setInertSet, but that function is useful for the GHC API.

- - - - -
694ec5b1 by sheaf at 2023-08-30T10:18:32-04:00
Don't bundle children for non-parent Avails

We used to bundle all children of the parent Avail with things that
aren't the parent, e.g. with

  class C a where
    type T a
    meth :: ..

we would bundle the whole Avail (C, T, meth) with all of C, T and meth,
instead of only with C.

Avoiding this fixes #23570

- - - - -
d926380d by Krzysztof Gogolewski at 2023-08-30T10:19:08-04:00
Fix typos

- - - - -
d07080d2 by Josh Meredith at 2023-08-30T19:42:32-04:00
JS: Implement missing C functions `rename`, `realpath`, and `getcwd` (#23806)

- - - - -
e2940272 by David Binder at 2023-08-30T19:43:08-04:00
Bump submodules of hpc and hpc-bin to version 0.7.0.0

hpc 0.7.0.0 dropped SafeHaskell safety guarantees in order to simplify
compatibility with newer versions of the directory package which
dropped all SafeHaskell guarantees.

- - - - -
5d56d05c by David Binder at 2023-08-30T19:43:08-04:00
Bump hpc bound in ghc.cabal.in

- - - - -
99fff496 by Dominik Schrempf at 2023-08-31T00:04:46-04:00
ghc classes documentation: rm redundant comment

- - - - -
fe021bab by Dominik Schrempf at 2023-08-31T00:04:46-04:00
prelude documentation: various nits

- - - - -
48c84547 by Dominik Schrempf at 2023-08-31T00:04:46-04:00
integer documentation: minor corrections

- - - - -
20cd12f4 by Dominik Schrempf at 2023-08-31T00:04:46-04:00
real documentation: nits

- - - - -
dd39bdc0 by sheaf at 2023-08-31T00:05:27-04:00
Add a test for #21765

This issue (of reporting a constraint as being redundant even though
removing it causes typechecking to fail) was fixed in aed1974e.
This commit simply adds a regression test.

Fixes #21765

- - - - -
f1ec3628 by Bodigrim at 2023-08-31T23:53:30-04:00
Export foldl' from Prelude and bump submodules

See https://github.com/haskell/core-libraries-committee/issues/167 for discussion

Metric Decrease:
    T8095
    T13386
Metric Increase:
    T13386
    T8095

T8095 ghc/alloc decreased on x86_64, but increased on aarch64.
T13386 ghc/alloc decreased on x86_64-windows, but increased on other platforms.
Neither has anything to do with `foldl'`, so I conclude that both are flaky.

- - - - -
3181b97d by Gergő Érdi at 2023-08-31T23:54:06-04:00
Allow cross-tyvar defaulting proposals from plugins

Fixes #23832.

- - - - -
e4af506e by Sebastian Graf at 2023-09-01T14:29:12-04:00
Clarify Note [GlobalId/LocalId] after CorePrep (#23797)

Fixes #23797.

- - - - -
ac29787c by Sylvain Henry at 2023-09-01T14:30:02-04:00
Fix warning with UNPACK on sum type (#23921)

- - - - -
9765ac7b by Zubin Duggal at 2023-09-05T00:37:45-04:00
hadrian: track python dependencies in doc rules

- - - - -
1578215f by sheaf at 2023-09-05T00:38:26-04:00
Bump Haddock to fix #23616

This commit updates the Haddock submodule to include
the fix to #23616.

Fixes #23616

- - - - -
5a2fe35a by David Binder at 2023-09-05T00:39:07-04:00
Fix example in GHC user guide in SafeHaskell section

The example given in the SafeHaskell section uses an implementation of
Monad which no longer works. This MR removes the non-canonical return
instance and adds the necessary instances of Functor and Applicative.

- - - - -
291d81ae by Matthew Pickering at 2023-09-05T14:03:10-04:00
driver: Check transitive closure of haskell package dependencies when deciding whether to relink

We were previously just checking whether direct package dependencies had
been modified. This caused issues when compiling without optimisations
as we wouldn't relink the direct dependency if one of its dependenices
changed.

Fixes #23724

- - - - -
35da0775 by Krzysztof Gogolewski at 2023-09-05T14:03:47-04:00
Re-export GHC.Utils.Panic.Plain from GHC.Utils.Panic

Fixes #23930

- - - - -
17c03ff5 by Alan Zimmerman at 2023-09-05T21:53:30+01:00
EPA: Replace Monoid with NoAnn

We currently use the Monoid class as a constraint on Exact Print
Annotation functions, so we can use mempty. But this leads to
requiring Semigroup instances too, which do not always make sense.

Instead, introduce a class NoAnn, with a function noAnn analogous to
mempty.

Closes #20372

- - - - -
304844af by Alan Zimmerman at 2023-09-05T22:13:11+01:00
EPA: Instroduce HasAnnotation class

All tests pass [2023-08-10 Thu]

- - - - -
474a6501 by Alan Zimmerman at 2023-09-05T22:13:11+01:00
EPA: put noAnnSrcSpan in HasAnnotation

All tests pass [2023-08-13 Sun]

- - - - -
0fd50509 by Alan Zimmerman at 2023-09-05T22:13:11+01:00
EPA: Fix span for GRHS

Tests all pass [2023-08-13 Sun]

- - - - -
b7082ac7 by Alan Zimmerman at 2023-09-05T22:13:12+01:00
EPA: Move TrailingAnns from last match to FunBind

All tests pass [2023-08-13 Sun]

- - - - -
434d64c6 by Alan Zimmerman at 2023-09-05T22:13:12+01:00
EPA: Fix GADT where clause span

Include the final '}' if there is one.

Note: Makes no difference to a test, need to add one.

- - - - -
31941cbb by Alan Zimmerman at 2023-09-05T22:13:12+01:00
EPA: Capture full range for a CaseAlt Match

All tests pass [2023-08-30 Wed]
And check-exact no warnings

- - - - -
f6b4f71f by Alan Zimmerman at 2023-09-05T22:13:12+01:00
EPA Use full range for Anchor, and do not widen for [TrailingAnn]

Known failures at the end of this
  Ppr023
  Ppr034
  TestBoolFormula

Fixed in subsequent commits

- - - - -
a3e34db9 by Alan Zimmerman at 2023-09-05T22:13:12+01:00
EPA: Use the current Anchor end as prior end

Use the original anchor location end as the source of truth for
calculating print deltas.

This allows original spacing to apply in most cases, only changed AST
items need initial delta positions.

[2023-08-14 Mon]
121 unexpected failures

- - - - -
9b0713e7 by Alan Zimmerman at 2023-09-05T22:13:12+01:00
EPA: Add DArrow to TrailingAnn

- - - - -
6cd84aa2 by Alan Zimmerman at 2023-09-05T22:13:13+01:00
[EPA] Introduce HasTrailing in ExactPrint

29 Failing tests by 4600 processed

- - - - -
30d70627 by Alan Zimmerman at 2023-09-05T22:13:13+01:00
Summary: HasTrailing instances

- - - - -
6fae0c97 by Alan Zimmerman at 2023-09-05T22:13:13+01:00
EPA use [TrailingAnn] in enterAnn

And remove it from ExactPrint (LocatedN RdrName)

- - - - -
b488a652 by Alan Zimmerman at 2023-09-05T22:13:13+01:00
Summary: Patch:  epa-in-hsdo-put-trailinganns
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   2023-07-03 22:33:49 +0100

EPA: In HsDo, put TrailingAnns at top of LastStmt

Failures
5300 of 9700 [0, 103, 0]

- - - - -
1ade3d6e by Alan Zimmerman at 2023-09-05T22:13:13+01:00
EPA: do not convert comments to deltas when balancing.

It seems its not needed with the new approach

[2023-08-15 Tue]
104 unexpected failures

- - - - -
7cb52f0d by Alan Zimmerman at 2023-09-05T22:13:13+01:00
EPA: deal with fallout from getMonoBind

- - - - -
0170d27c by Alan Zimmerman at 2023-09-05T22:13:13+01:00
EPA fix captureLineSpacing

- - - - -
aaae9aa6 by Alan Zimmerman at 2023-09-05T22:13:13+01:00
EPA print any comments in the span before exiting it

- - - - -
efe381d8 by Alan Zimmerman at 2023-09-05T22:13:14+01:00
EPA: getting rid of tweakDelta

WIP at present

- - - - -
d51e4c85 by Alan Zimmerman at 2023-09-05T22:13:14+01:00
EPA: tweaks to ExactPrint

- - - - -
15cd94ec by Alan Zimmerman at 2023-09-05T22:13:14+01:00
EPA: Fix warnings in check-exact

- - - - -
5e82b926 by Alan Zimmerman at 2023-09-05T22:13:14+01:00
Summary: Patch:  epa-anchor-op-comments
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   2023-07-25 22:40:51 +0100

EPA: Add comments to AnchorOperation

6000 of 9700 [0, 14, 0]
Failures seem to be mainly in transform tests

- - - - -
7fe0dfe7 by Alan Zimmerman at 2023-09-05T22:13:14+01:00
Summary: Patch:  epa-remove-anneofcomment
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   2023-07-26 22:00:58 +0100

EPA: remove AnnEofComment

It is no longer used

At this point just failures
  HsDocTy

[2023-08-31 Thu]
And no warnings in check-exact

- - - - -
aca2959a by Alan Zimmerman at 2023-09-05T22:13:14+01:00
EPA: make locA a function, not a field name

- - - - -
5b1f7247 by Alan Zimmerman at 2023-09-05T22:13:14+01:00
Summary: Patch:  epa-generalise-reloc
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   2023-07-23 23:05:42 +0100

EPA: generalise reLoc

Normal 2 failures

- - - - -
0a33d2d6 by Alan Zimmerman at 2023-09-05T22:13:14+01:00
EPA: get rid of l2l and friends

- - - - -
106df224 by Alan Zimmerman at 2023-09-05T22:13:15+01:00
EPA: get rid of l2l and friends

- - - - -
f6a5f203 by Alan Zimmerman at 2023-09-05T22:13:15+01:00
EPA: harmonise acsa and acsA

- - - - -
2418f556 by Alan Zimmerman at 2023-09-05T22:13:15+01:00
EPA: Replace Anchor with EpaLocation

- - - - -
668acde8 by Alan Zimmerman at 2023-09-05T22:13:15+01:00
EPA: get rid of AnchorOperation

- - - - -
1f83223d by Alan Zimmerman at 2023-09-05T22:13:15+01:00
EPA: splitLHsForAllTyInvis no ann returned

- - - - -
1e2745b2 by Alan Zimmerman at 2023-09-05T22:13:15+01:00
EPA: Replace Monoid with NoAnn

[2023-08-19 Sat]
AddClassMethod fails

- - - - -
e91e50c2 by Alan Zimmerman at 2023-09-05T22:13:16+01:00
EPA: Use SrcSpan in EpaSpan

[2023-09-04 Mon]
No errors or warnings in check-exact

- - - - -
eb30a0ff by Alan Zimmerman at 2023-09-05T22:13:16+01:00
EPA: Present no longer has annotation

- - - - -
eae0c004 by Alan Zimmerman at 2023-09-05T22:13:16+01:00
EPA: empty tup_tail has no ann

Parser.y: tup_tail rule was
          | {- empty -} %shift   { return [Left noAnn] }

This means we add an extra Missing constructor if the last item was a comma.

Change the annotation type to a Bool to indicate this, and use the
EpAnn Anchor for the print location for the others.

- - - - -
51ca92c7 by Alan Zimmerman at 2023-09-05T22:13:16+01:00
EPA: Remove parenthesizeHsType

- - - - -
743127bf by Alan Zimmerman at 2023-09-05T22:13:16+01:00
EPA: Remove EpAnnNotUsed

- - - - -
1a40eca9 by Alan Zimmerman at 2023-09-05T22:13:16+01:00
EPA: Remove SrcSpanAnn

- - - - -
eca9385d by Alan Zimmerman at 2023-09-05T22:13:17+01:00
EPA: Remove SrcSpanAnn completely

- - - - -
0b81ed0c by Alan Zimmerman at 2023-09-05T22:13:17+01:00
Clean up mkScope

- - - - -
c90884d0 by Alan Zimmerman at 2023-09-05T22:13:17+01:00
EPA: Clean up TC Monad Utils

- - - - -
bf781f55 by Alan Zimmerman at 2023-09-05T22:13:17+01:00
EPA: EpaDelta for comment has no comments

- - - - -


30 changed files:

- .gitlab/ci.sh
- .gitlab/rel_eng/upload.sh
- README.md
- compiler/GHC.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/PrimOps/Casts.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/Types/Prim.hs
- compiler/GHC/Builtin/Uniques.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Info.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Regs.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Class.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/FamInstEnv.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ef6c2e6ba549ea9567c0eef017672d708fdb2141...bf781f55beca7d3723388566ec9612cf89386345

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ef6c2e6ba549ea9567c0eef017672d708fdb2141...bf781f55beca7d3723388566ec9612cf89386345
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/20230905/54cfcc25/attachment-0001.html>


More information about the ghc-commits mailing list