Skip to content

Keep old bindings until :load succeeds

Imagine you make a change to a module which is already loaded into GHCi and then try to :load it again. If the load fails not only will you not have the new bindings but the old ones are lost as well. This prevents you from e.g. using :type to figure out why your new change doesn't type check.

A more ambitious solution would be to try to incrementally load the module and keep all bindings up to the one that fails (and its dependents.) This would allow you to debug the failure more interactively (e.g. compose functions and look at their combined types.) This is probably trickier as previous bindings might be invalidated.

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