From 0f8872ecac49b2e4075e64ac93269a4a78d69cff Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Fri, 28 May 2021 09:48:27 +0200 Subject: Fix and slight improvement to datacon worker/wrapper notes --- compiler/GHC/Core/DataCon.hs | 3 +++ 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 -- cgit v1.2.1