[Git][ghc/ghc][wip/T22194-flags] 26 commits: Be more careful about quantification

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Wed Mar 22 12:48:07 UTC 2023



Simon Peyton Jones pushed to branch wip/T22194-flags at Glasgow Haskell Compiler / GHC


Commits:
926ad6de by Simon Peyton Jones at 2023-03-22T01:03:08-04:00
Be more careful about quantification

This MR is driven by #23051. It does several things:

* It is guided by the generalisation plan described in #20686.
  But it is still far from a complete implementation of that plan.

* Add Note [Inferred type with escaping kind] to GHC.Tc.Gen.Bind.
  This explains that we don't (yet, pending #20686) directly
  prevent generalising over escaping kinds.

* In `GHC.Tc.Utils.TcMType.defaultTyVar` we default RuntimeRep
  and Multiplicity variables, beause we don't want to quantify over
  them.  We want to do the same for a Concrete tyvar, but there is
  nothing sensible to default it to (unless it has kind RuntimeRep,
  in which case it'll be caught by an earlier case). So we promote
  instead.

* Pure refactoring in GHC.Tc.Solver:
  * Rename decideMonoTyVars to decidePromotedTyVars, since that's
    what it does.

  * Move the actual promotion of the tyvars-to-promote from
    `defaultTyVarsAndSimplify` to `decidePromotedTyVars`.  This is a
    no-op; just tidies up the code.  E.g then we don't need to
    return the promoted tyvars from `decidePromotedTyVars`.

  * A little refactoring in `defaultTyVarsAndSimplify`, but no
    change in behaviour.

* When making a TauTv unification variable into a ConcreteTv
  (in GHC.Tc.Utils.Concrete.makeTypeConcrete), preserve the occ-name
  of the type variable.  This just improves error messages.

* Kill off dead code: GHC.Tc.Utils.TcMType.newConcreteHole

- - - - -
0ab0cc11 by Sylvain Henry at 2023-03-22T01:03:48-04:00
Testsuite: use appropriate predicate for ManyUbxSums test (#22576)

- - - - -
048c881e by romes at 2023-03-22T01:04:24-04:00
fix: Incorrect @since annotations in GHC.TypeError

Fixes #23128

- - - - -
a1528b68 by Sylvain Henry at 2023-03-22T01:05:04-04:00
Testsuite: use req_interp predicate for T16318 (#22370)

- - - - -
ad765b6f by Sylvain Henry at 2023-03-22T01:05:04-04:00
Testsuite: use req_interp predicate for T20214

- - - - -
e0b8eaf3 by Simon Peyton Jones at 2023-03-22T09:50:13+00:00
Refactor the constraint solver pipeline

The big change is to put the entire type-equality solver into
GHC.Tc.Solver.Equality, rather than scattering it over Canonical
and Interact.  Other changes

* EqCt becomes its own data type, a bit like QCInst.  This is
  great because EqualCtList is then just [EqCt]

* New module GHC.Tc.Solver.Dict has come of the class-contraint
  solver.  In due course it will be all.  One step at a time.

This MR is intended to have zero change in behaviour: it is a
pure refactor.  It opens the way to subsequent tidying up, we
believe.

- - - - -
b2d35320 by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
DRAFT: Refactor the way we establish a canonical constraint

Relevant to #22194

Incomplete; but I'd like to see the CI results

- - - - -
3c1e1f9f by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
Wibbles

- - - - -
c1417307 by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
Wibbles

- - - - -
a5234095 by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
Wibbles

- - - - -
be59f757 by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
Use a flag-based approach for checkTyEqRhs

...looks much nicer

- - - - -
6efc7553 by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
Wibble

- - - - -
a0e44e0c by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
Bug fixes

- - - - -
7a501ffa by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
More bug fixes

- - - - -
1b8ab979 by Simon Peyton Jones at 2023-03-22T12:05:56+00:00
Minor fixes

- - - - -
fbf8fd06 by Simon Peyton Jones at 2023-03-22T12:05:57+00:00
Fix isConcreteTyCon

Adds a synIsConcrete to SynonymTyCon

- - - - -
4ca5493b by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
More wibbles

- - - - -
c910adcf by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
Add a fast path simpleUnifyCheck

- - - - -
2610291b by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
Wibble

- - - - -
4137ec61 by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
Respond to Richard's review

- - - - -
013348d3 by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
More wibbles, prompted by talking with Richard

- - - - -
b3ceb28c by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
More wibbles

- - - - -
4b96e1cb by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
Wibbles

- - - - -
9b2d3ace by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
Wibble

- - - - -
1b0abad3 by Simon Peyton Jones at 2023-03-22T12:07:45+00:00
Wibbles

- - - - -
d5ffcc70 by Simon Peyton Jones at 2023-03-22T12:49:31+00:00
wibbles

- - - - -


12 changed files:

- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Data/Bag.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Canonical.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bd132a9b37ce1b7c35bffe7a161415db3cde4ccb...d5ffcc702d5c9be56c0abe27df64d8f3ddcca419

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bd132a9b37ce1b7c35bffe7a161415db3cde4ccb...d5ffcc702d5c9be56c0abe27df64d8f3ddcca419
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/20230322/ed9296e7/attachment-0001.html>


More information about the ghc-commits mailing list