diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-05-28 09:48:27 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-29 10:18:01 -0400 |
commit | 0f8872ecac49b2e4075e64ac93269a4a78d69cff (patch) | |
tree | 71f97e7862d0ff359ab0e501f59061903e50d41b | |
parent | 453877600b78fbb8d53ebc1754e79879456b8419 (diff) | |
download | haskell-0f8872ecac49b2e4075e64ac93269a4a78d69cff.tar.gz |
Fix and slight improvement to datacon worker/wrapper notes
-rw-r--r-- | compiler/GHC/Core/DataCon.hs | 3 | ||||
-rw-r--r-- | compiler/GHC/Types/Id/Make.hs | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/GHC/Core/DataCon.hs b/compiler/GHC/Core/DataCon.hs index bbc02310f7..1b814b5213 100644 --- a/compiler/GHC/Core/DataCon.hs +++ b/compiler/GHC/Core/DataCon.hs @@ -195,6 +195,9 @@ Note [Data constructor workers and wrappers] * INVARIANT: the dictionary constructor for a class never has a wrapper. +* See Note [Data Constructor Naming] for how the worker and wrapper + are named + * Neither_ the worker _nor_ the wrapper take the dcStupidTheta dicts as arguments * The wrapper (if it exists) takes dcOrigArgTys as its arguments. diff --git a/compiler/GHC/Types/Id/Make.hs b/compiler/GHC/Types/Id/Make.hs index dc1663a7ff..b34c0fc8cb 100644 --- a/compiler/GHC/Types/Id/Make.hs +++ b/compiler/GHC/Types/Id/Make.hs @@ -845,8 +845,8 @@ dataConWrapperInlinePragma = alwaysInlinePragma { inl_rule = ConLike {- Note [Activation for data constructor wrappers] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The Activation on a data constructor wrapper allows it to inline only in Phase -0. This way rules have a chance to fire if they mention a data constructor on +The Activation on a data constructor wrapper allows it to inline only in FinalPhase. +This way rules have a chance to fire if they mention a data constructor on the left RULE "foo" f (K a b) = ... Since the LHS of rules are simplified with InitialPhase, we won't |