[Git][ghc/ghc][master] 2 commits: Refactoring in preparation for lazy skolemisation
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Tue Feb 6 15:12:31 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
e2ea933f by Simon Peyton Jones at 2024-02-06T10:12:04-05:00
Refactoring in preparation for lazy skolemisation
* Make HsMatchContext and HsStmtContext be parameterised over the
function name itself, rather than over the pass.
See [mc_fun field of FunRhs] in Language.Haskell.Syntax.Expr
- Replace types
HsMatchContext GhcPs --> HsMatchContextPs
HsMatchContext GhcRn --> HsMatchContextRn
HsMatchContext GhcTc --> HsMatchContextRn (sic! not Tc)
HsStmtContext GhcRn --> HsStmtContextRn
- Kill off convertHsMatchCtxt
* Split GHC.Tc.Type.BasicTypes.TcSigInfo so that TcCompleteSig (describing
a complete user-supplied signature) is its own data type.
- Split TcIdSigInfo(CompleteSig, PartialSig) into
TcCompleteSig(CSig)
TcPartialSig(PSig)
- Use TcCompleteSig in tcPolyCheck, CheckGen
- Rename types and data constructors:
TcIdSigInfo --> TcIdSig
TcPatSynInfo(TPSI) --> TcPatSynSig(PatSig)
- Shuffle around helper functions:
tcSigInfoName (moved to GHC.Tc.Types.BasicTypes)
completeSigPolyId_maybe (moved to GHC.Tc.Types.BasicTypes)
tcIdSigName (inlined and removed)
tcIdSigLoc (introduced)
- Rearrange the pattern match in chooseInferredQuantifiers
* Rename functions and types:
tcMatchesCase --> tcCaseMatches
tcMatchesFun --> tcFunBindMatches
tcMatchLambda --> tcLambdaMatches
tcPats --> tcMatchPats
matchActualFunTysRho --> matchActualFunTys
matchActualFunTySigma --> matchActualFunTy
* Add HasDebugCallStack constraints to:
mkBigCoreVarTupTy, mkBigCoreTupTy, boxTy,
mkPiTy, mkPiTys, splitAppTys, splitTyConAppNoView_maybe
* Use `penv` from the outer context in the inner loop of
GHC.Tc.Gen.Pat.tcMultiple
* Move tcMkVisFunTy, tcMkInvisFunTy, tcMkScaledFunTys down the file,
factor out and export tcMkScaledFunTy.
* Move isPatSigCtxt down the file.
* Formatting and comments
Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com>
- - - - -
f5d3e03c by Andrei Borzenkov at 2024-02-06T10:12:04-05: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 accompanying refactoring:
* 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/Parser/PostProcess.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/Rename/Utils.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
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ce90f12f53dca5c55e87158d60529340a75851d2...f5d3e03c56ffc632d8fbf1766aca981e498fcaef
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ce90f12f53dca5c55e87158d60529340a75851d2...f5d3e03c56ffc632d8fbf1766aca981e498fcaef
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/20240206/fd528717/attachment.html>
More information about the ghc-commits
mailing list