[Git][ghc/ghc][wip/expand-do] 11 commits: chore: Correct typo in the gitlab MR template

Apoorv Ingle (@ani) gitlab at gitlab.haskell.org
Thu Nov 23 05:07:18 UTC 2023



Apoorv Ingle pushed to branch wip/expand-do at Glasgow Haskell Compiler / GHC


Commits:
e9d5ae41 by Owen Shepherd at 2023-11-21T18:32:23-05:00
chore: Correct typo in the gitlab MR template

[skip ci]

- - - - -
f158a8d0 by Rodrigo Mesquita at 2023-11-21T18:32:59-05:00
Improve error message when reading invalid `.target` files

A `.target` file generated by ghc-toolchain or by configure can become
invalid if the target representation (`Toolchain.Target`) is changed
while the files are not re-generated by calling `./configure` or
`ghc-toolchain` again. There is also the issue of hadrian caching the
dependencies on `.target` files, which makes parsing fail when reading
reading the cached value if the representation has been updated.

This patch provides a better error message in both situations, moving
away from a terrible `Prelude.read: no parse` error that you would get
otherwise.

Fixes #24199

- - - - -
955520c6 by Ben Gamari at 2023-11-21T18:33:34-05:00
users guide: Note that QuantifiedConstraints implies ExplicitForAll

Fixes #24025.

- - - - -
17ec3e97 by Owen Shepherd at 2023-11-22T09:37:28+01:00
fix: Change type signatures in NonEmpty export comments to reflect reality

This fixes several typos in the comments of
Data.List.NonEmpty export list items.

- - - - -
2fd78f9f by Samuel Thibault at 2023-11-22T11:49:13-05:00
Fix the platform string for GNU/Hurd

As commited in Cargo
https://github.com/haskell/cabal/pull/9434
there is confusion between "gnu" and "hurd". This got fixed in Cargo, we
need the converse in Hadrian.

Fixes #24180

- - - - -
a79960fe by Alan Zimmerman at 2023-11-22T11:49:48-05:00
EPA: Tuple Present no longer has annotation

The Present constructor for a Tuple argument will never have an exact
print annotation. So make this impossible.

- - - - -
121c9ab7 by David Binder at 2023-11-22T21:12:29-05:00
Unify the hpc testsuites

The hpc testsuite was split between testsuite/tests/hpc
and the submodule libraries/hpc/test. This commit unifies
the two testsuites in the GHC repository in the directory
testsuite/tests/hpc.

- - - - -
d2733a05 by Alan Zimmerman at 2023-11-22T21:13:05-05:00
EPA: empty tup_tail has noAnn

In Parser.y, the tup_tail rule had the following option
          | {- empty -} %shift   { return [Left noAnn] }

Once this works through PostProcess.hs, it 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.

- - - - -
a3f4eb18 by Apoorv Ingle at 2023-11-22T23:05:24-06:00
Expand `do` blocks right before typechecking using the `HsExpansion` philosophy.

- A step towards killing `tcSyntaxOp`

- Fixes #18324 #20020 #23147 #22788 #15598 #22086 #21206

- Note [Expanding HsDo with HsExpansion] in `GHC.Tc.Gen.Do` explains change in detail

- Note Note [Doing HsExpansion in the Renamer vs Typechecker] in `GHC.Rename.Expr` expains the rational of doing expansions in type checker as opposed to in the renamer

- New datatype to make this expansion work `GHC.Hs.Expr.XXExprGhcRn`:
    1. Expansion bits for Expressions, Statements and Patterns in (`ExpandedThingRn`)
    2. `PopErrCtxt` a special GhcRn Phase only artifcat to pop the previous error message in the error context stack
- Kills `HsExpansion` and `HsExpanded` as we have inlined them in `XXExprGhcRn` and `XXExprGhcTc`

- `GHC.Basic.Origin` now tracks the reason for expansion in case of Generated
  This is useful for type checking cf. `GHC.Tc.Gen.Expr.tcExpr` case for `HsLam`

- Ensures warnings such as
  1. Pattern mach checks
  2. Failable patterns
  3. non-() return in body statements are preserved

- Expansions inside Template haskell also work without issues.

- Kill `HsMatchCtxt` in favor of `TcMatchAltChecker`
- Make records Expand and not desugar before typechecking.

- Testcases:
  * T18324 T20020 T23147 T22788 T15598 T22086
  * T23147b (error message check),
  * DoubleMatch (match inside a match for pmc check)
  * pattern-fails (check pattern match with non-refutable pattern, eg. newtype)
  * Simple-rec (rec statements inside do statment)
  * T22788 (code snippet from #22788)
  * DoExpanion1 (Error messages for body statments)
  * DoExpansion2 (Error messages for bind statements)
  * DoExpansion3 (Error messages for let statements)

- - - - -
42b888f3 by Apoorv Ingle at 2023-11-22T23:05:24-06:00
- Renaming `GHC.Types.Basic.{Origin -> MatchOrigin}`

- - - - -
4c3d3724 by Apoorv Ingle at 2023-11-22T23:05:24-06:00
- hpc ticks, Do not count pattern match failures

- - - - -


30 changed files:

- .gitlab/merge_request_templates/Default.md
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Utils.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- + compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/039d28f342a574f6c15204c8467d1e6da5554e11...4c3d3724e5b9a06767cf9e29326600be03cccd67

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/039d28f342a574f6c15204c8467d1e6da5554e11...4c3d3724e5b9a06767cf9e29326600be03cccd67
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/20231123/7d08b5d1/attachment.html>


More information about the ghc-commits mailing list