diff options
author | sheaf <sam.derbyshire@gmail.com> | 2022-04-07 22:59:56 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-08 13:57:07 -0400 |
commit | 23f95735825cd2bfb8d84337cd502d2b2ff533c5 (patch) | |
tree | 953e33ebe1b8d2caa30627795c01e533cea003cb /compiler/GHC/Hs/Expr.hs | |
parent | 3415981c36631115bc1d7fb5b51abfcc2932a12f (diff) | |
download | haskell-23f95735825cd2bfb8d84337cd502d2b2ff533c5.tar.gz |
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.
Diffstat (limited to 'compiler/GHC/Hs/Expr.hs')
-rw-r--r-- | compiler/GHC/Hs/Expr.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs index 6020950c11..a4960ca555 100644 --- a/compiler/GHC/Hs/Expr.hs +++ b/compiler/GHC/Hs/Expr.hs @@ -52,7 +52,6 @@ import GHC.Types.Fixity import GHC.Types.SourceText import GHC.Types.SrcLoc import GHC.Types.Tickish (CoreTickish) -import GHC.Types.Var( InvisTVBinder ) import GHC.Core.ConLike import GHC.Unit.Module (ModuleName) import GHC.Utils.Misc @@ -62,7 +61,7 @@ import GHC.Utils.Panic.Plain import GHC.Data.FastString import GHC.Core.Type import GHC.Builtin.Types (mkTupleStr) -import GHC.Tc.Utils.TcType (TcType) +import GHC.Tc.Utils.TcType (TcType, TcTyVar) import {-# SOURCE #-} GHC.Tc.Types (TcLclEnv) -- libraries: @@ -507,7 +506,7 @@ data XXExprGhcTc -- GHC.Tc.Gen.Head -- The two arguments describe how to eta-expand -- the data constructor when desugaring - ConLike [InvisTVBinder] [Scaled TcType] + ConLike [TcTyVar] [Scaled TcType] --------------------------------------- -- Haskell program coverage (Hpc) Support |