On Tue, Jun 23, 2026 at 01:07:58AM -0700, Evan Laforge wrote:
Loaded GHCi configuration from /Users/elaforge/qlib/dotfiles/.ghci Prelude> :load BugC [1 of 3] Compiling BugA ( BugA.hs, BugA.o ) [2 of 3] Compiling BugB ( BugB.hs, BugB.o ) [3 of 3] Compiling BugC ( BugC.hs, BugC.o ) Ok, three modules loaded. Leaving GHCi. % ghci Prelude> :load BugC Ok, three modules loaded. Prelude BugC> bug 13
As expected! Now go edit BugA.hs, and change 13 to say 14, and save. Now reload:
Prelude BugC> :r [1 of 3] Compiling BugA ( BugA.hs, interpreted ) [Source file changed] Ok, three modules reloaded. Prelude BugC> bug 13
I am unable to reproduce the above with either GHC 9.12.4 or GHC 9.14.1 on a Fedora 43 x86_64 system. Every change in BugA.hs changes the output of "bug" after a ":r" reload. $ tail -n1 BugA.hs x = 17 $ ghci -fobject-code GHCi, version 9.12.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/viktor/.ghc/ghci.conf λ> :load BugC [1 of 3] Compiling BugA ( BugA.hs, BugA.o ) [2 of 3] Compiling BugB ( BugB.hs, BugB.o ) [3 of 3] Compiling BugC ( BugC.hs, BugC.o ) Ok, three modules loaded. λ> bug 17 λ> [1]+ Stopped ghci -fobject-code $ perl -pi -e 's/17/18/' BugA.hs $ tail -n1 BugA.hs x = 18 $ fg ghci -fobject-code λ> :r [1 of 3] Compiling BugA ( BugA.hs, BugA.o ) [Source file changed] Ok, three modules reloaded. λ> bug 18 λ> Leaving GHCi. -- Viktor. 🇺🇦 Слава Україні!