GHCi recompilation avoidance UI

David Feuer david at
Tue Oct 31 15:42:11 UTC 2017

Changes in GHC 8.2.1 lead to a lot of recompilation, because GHCi now refuses to load optimized
code unless -fobject-code (and optimization flags) are enabled. I propose the following slight
modification to

1. Optimization flags (except -O0) imply -fobject-code. This ensures that GHC respects optimization flags regardless of --interactive. 

2. Even when -fobject-code is on, :load *M will load M as bytecode. This provides the "escape hatch" from -fobject-code that you need to use debugging features, etc. 

3. New -fignore-optim-changes and -fignore-hpc-changes (​​Phab:D4123) flags should enable users to put together object code and bytecode with diverse optimization levels/options and HPC options while still updating automatically based on source changes and whether profiling is enabled.

Does this seem like a reasonable way forward?

David Feuer

More information about the ghc-devs mailing list