summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/TyCo/Rep.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Core/TyCo/Rep.hs')
-rw-r--r--compiler/GHC/Core/TyCo/Rep.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/GHC/Core/TyCo/Rep.hs b/compiler/GHC/Core/TyCo/Rep.hs
index 493b2d767a..636dc87405 100644
--- a/compiler/GHC/Core/TyCo/Rep.hs
+++ b/compiler/GHC/Core/TyCo/Rep.hs
@@ -1928,13 +1928,16 @@ GHC.Core.Multiplicity above this module.
-}
-- | A shorthand for data with an attached 'Mult' element (the multiplicity).
-data Scaled a = Scaled Mult a
+data Scaled a = Scaled !Mult a
deriving (Data.Data)
-- You might think that this would be a natural candidate for
-- Functor, Traversable but Krzysztof says (!3674) "it was too easy
-- to accidentally lift functions (substitutions, zonking etc.) from
-- Type -> Type to Scaled Type -> Scaled Type, ignoring
-- multiplicities and causing bugs". So we don't.
+ --
+ -- Being strict in a is worse for performance, so we are only strict on the
+ -- Mult part of scaled.
instance (Outputable a) => Outputable (Scaled a) where