[Git][ghc/ghc][wip/sand-witch/lazy-skol] Lazy skolemisation for @a-binders (#17594)
Simon Peyton Jones (@simonpj)
gitlab at gitlab.haskell.org
Wed Jan 31 21:33:20 UTC 2024
Simon Peyton Jones pushed to branch wip/sand-witch/lazy-skol at Glasgow Haskell Compiler / GHC
Commits:
9131d1b4 by Andrei Borzenkov at 2024-01-31T21:32:32+00:00
Lazy skolemisation for @a-binders (#17594)
This patch is a preparation for @a-binders implementation. The main changes are:
* Skolemisation is now prepared to deal with @binders.
See Note [Skolemisation overview] in GHC.Tc.Utils.Unify.
Most of the action is in
- Utils.Unify.matchExpectedFunTys
- Gen.Pat.tcMatchPats
- Gen.Expr.tcPolyExprCheck
- Gen.Binds.tcPolyCheck
Some significant accompanying refactoring
* Quite a bit of renaming, e.g.
tcMatchesCase --> tcCaseMatches
tcMatchesFun --> tcFunBindMatches
tcPats --> tcMatchPats
matchActualFunTysRho --> matchActualFunTys
matchActualFunTySigma --> matchActualFunTy
* Split GHC.Tc.Type.BasicTypes.TcSigInfo so that TcCompleteSig (describing
a complete user-supplied signature) is its own data type.
Fewer "panic" cases!
* Make Language.Haskell.Syntax.Expr.HsMatchContext be parameterised
over the function itself, rather than over the pass. See
Note [mc_fun field of FunRhs] in that module.
* Remove the HsMatchContext field of TcMatchCtxt; and then kill off the latter entirely.
Instead get the HsMatchContext from the Match being typechecked. Simpler.
* I found that funTyConAppTy_maybe was doing a lot of allocation, and
rejigged userTypeError_maybe to avoid calling it.
- - - - -
30 changed files:
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/GuardedRHSs.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match.hs-boot
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Utils.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Expr.hs-boot
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Tc/Deriv/Functor.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Expr.hs-boot
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9131d1b4908a8a6597c63f0f437f23bd401b041a
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9131d1b4908a8a6597c63f0f437f23bd401b041a
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/20240131/a6405664/attachment-0001.html>
More information about the ghc-commits
mailing list