Docs: datacon eta-expansion, rep-poly checks
The existing notes weren't very clear on how the eta-expansion of data constructors that occurs in tcInferDataCon/dsConLike interacts with the representation polymorphism invariants. So we explain with a few more details how we ensure that the representation-polymorphic lambdas introduced by tcInferDataCon/dsConLike don't end up causing problems, by checking they are properly instantiated and then relying on the simple optimiser to perform beta reduction. A few additional changes: - ConLikeTc just take type variables instead of binders, as we never actually used the binders. - Removed the FRRApp constructor of FRROrigin; it was no longer used now that we use ExpectedFunTyOrigin. - Adds a bit of documentation to the constructors of ExpectedFunTyOrigin.
Showing
- compiler/GHC/Hs/Expr.hs 2 additions, 3 deletionscompiler/GHC/Hs/Expr.hs
- compiler/GHC/HsToCore/Expr.hs 2 additions, 3 deletionscompiler/GHC/HsToCore/Expr.hs
- compiler/GHC/Tc/Gen/App.hs 7 additions, 4 deletionscompiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Head.hs 30 additions, 13 deletionscompiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Types/Origin.hs 50 additions, 14 deletionscompiler/GHC/Tc/Types/Origin.hs
- testsuite/tests/rep-poly/RepPolyLambda.hs 11 additions, 0 deletionstestsuite/tests/rep-poly/RepPolyLambda.hs
- testsuite/tests/rep-poly/RepPolyLambda.stderr 8 additions, 0 deletionstestsuite/tests/rep-poly/RepPolyLambda.stderr
- testsuite/tests/rep-poly/all.T 1 addition, 0 deletionstestsuite/tests/rep-poly/all.T
Loading
Please register or sign in to comment