Skip to content

Field accessors unnecessarily kept alive

Suppose you have a record with some non-exported field accessors, like so:

module Lib (Rec) where

data Rec = Rec
  { f1 :: Int
  , f2 :: Int
  , f3 :: Int
  , f4 :: Int
  , f5 :: Int
  }

Code for fields f1, f2 ... are redundantly generated, optimized etc. and they made it to the object file, causing wasted compile times and bloated object files.

Trac metadata
Trac field Value
Version 8.0.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information