Project 'TerrorJack/ghc' was moved to 'haskell-wasm/ghc'. Please update any links and bookmarks that may still have the old path.
Do eager instantation in terms
This patch implements eager instantiation, a small but critical change to the type inference engine, #17173. The main change is this: When inferring types, always return an instantiated type (for now, deeply instantiated; in future shallowly instantiated) There is more discussion in https://www.tweag.io/posts/2020-04-02-lazy-eager-instantiation.html There is quite a bit of refactoring in this patch: * The ir_inst field of GHC.Tc.Utils.TcType.InferResultk has entirely gone. So tcInferInst and tcInferNoInst have collapsed into tcInfer. * Type inference of applications, via tcInferApp and tcInferAppHead, are substantially refactored, preparing the way for Quick Look impredicativity. * New pure function GHC.Tc.Gen.Expr.collectHsArgs and applyHsArgs are beatifully dual. We can see the zipper! * GHC.Tc.Gen.Expr.tcArgs is now much nicer; no longer needs to return a wrapper * In HsExpr, HsTypeApp now contains the the actual type argument, and is used in desugaring, rather than putting it in a mysterious wrapper. * I struggled a bit with good error reporting in Unify.matchActualFunTysPart. It's a little bit simpler than before, but still not great. Some smaller things * Rename tcPolyExpr --> tcCheckExpr tcMonoExpr --> tcLExpr * tcPatSig moves from GHC.Tc.Gen.HsType to GHC.Tc.Gen.Pat Metric Decrease: T9961 Reduction of 1.6% in comiler allocation on T9961, I think.
Showing
- compiler/GHC/Hs/Expr.hs 13 additions, 5 deletionscompiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Utils.hs 1 addition, 2 deletionscompiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Expr.hs 3 additions, 3 deletionscompiler/GHC/HsToCore/Expr.hs
- compiler/GHC/Rename/Splice.hs 3 additions, 3 deletionscompiler/GHC/Rename/Splice.hs
- compiler/GHC/Tc/Gen/Arrow.hs 9 additions, 9 deletionscompiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Bind.hs 4 additions, 6 deletionscompiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Expr.hs 431 additions, 373 deletionscompiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Expr.hs-boot 10 additions, 17 deletionscompiler/GHC/Tc/Gen/Expr.hs-boot
- compiler/GHC/Tc/Gen/Foreign.hs 1 addition, 1 deletioncompiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/HsType.hs 1 addition, 54 deletionscompiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs 31 additions, 32 deletionscompiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs 108 additions, 30 deletionscompiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Rule.hs 1 addition, 1 deletioncompiler/GHC/Tc/Gen/Rule.hs
- compiler/GHC/Tc/Gen/Splice.hs 5 additions, 5 deletionscompiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs 28 additions, 10 deletionscompiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs 4 additions, 5 deletionscompiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/Origin.hs 1 addition, 1 deletioncompiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Instantiate.hs 2 additions, 2 deletionscompiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/Monad.hs 1 addition, 2 deletionscompiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs 5 additions, 12 deletionscompiler/GHC/Tc/Utils/TcMType.hs
Loading
Please register or sign in to comment