summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Utils.hs
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2021-06-09 20:43:42 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-10 13:54:05 -0400
commit472c2bf003e9f3bb93b82265f2a0a7124f944421 (patch)
tree74767fe0b48521254b22350d4b1f34a3957adc06 /compiler/GHC/Core/Utils.hs
parent61c51c00b6e12e309bc5643e89330b93d86f5449 (diff)
downloadhaskell-472c2bf003e9f3bb93b82265f2a0a7124f944421.tar.gz
Reword: representation instead of levity
fixes #19756, updates haddock submodule
Diffstat (limited to 'compiler/GHC/Core/Utils.hs')
-rw-r--r--compiler/GHC/Core/Utils.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs
index b18e93c951..3ec00d76be 100644
--- a/compiler/GHC/Core/Utils.hs
+++ b/compiler/GHC/Core/Utils.hs
@@ -186,14 +186,14 @@ mkFunctionType mult arg_ty res_ty
mkLamTypes vs ty = foldr mkLamType ty vs
--- | Is this expression levity polymorphic? This should be the
+-- | Is this expression representation-polymorphic? This should be the
-- same as saying (isKindLevPoly . typeKind . exprType) but
-- much faster.
isExprLevPoly :: CoreExpr -> Bool
isExprLevPoly = go
where
- go (Var _) = False -- no levity-polymorphic binders
- go (Lit _) = False -- no levity-polymorphic literals
+ go (Var _) = False -- no representation-poly binders
+ go (Lit _) = False -- no representation-poly literals
go e@(App f _) | not (go_app f) = False
| otherwise = check_type e
go (Lam _ _) = False
@@ -209,9 +209,10 @@ isExprLevPoly = go
-- if the function is a variable (common case), check its
-- levityInfo. This might mean we don't need to look up and compute
-- on the type. Spec of these functions: return False if there is
- -- no possibility, ever, of this expression becoming levity polymorphic,
- -- no matter what it's applied to; return True otherwise.
- -- returning True is always safe. See also Note [Levity info] in
+ -- no possibility, ever, of this expression becoming
+ -- representation-polymorphic, no matter what it's applied to;
+ -- return True otherwise.
+ -- Returning True is always safe. See also Note [Levity info] in
-- IdInfo
go_app (Var id) = not (isNeverLevPolyId id)
go_app (Lit _) = False
@@ -1955,8 +1956,9 @@ exprIsTopLevelBindable :: CoreExpr -> Type -> Bool
-- see Note [Core top-level string literals] in "GHC.Core"
exprIsTopLevelBindable expr ty
= not (mightBeUnliftedType ty)
- -- Note that 'expr' may be levity polymorphic here consequently we must use
- -- 'mightBeUnliftedType' rather than 'isUnliftedType' as the latter would panic.
+ -- Note that 'expr' may be representation-polymorphic here, consequently
+ -- we must use 'mightBeUnliftedType' rather than 'isUnliftedType',
+ -- as the latter would panic.
|| exprIsTickedString expr
-- | Check if the expression is zero or more Ticks wrapped around a literal