Best way to run tests on file save
Haskell Community [Unofficial]
June 12, 2026
People usually use ghci for this.
ghcid (note the ‘d’) has some flags for rerunning tests. Assuming your tests don’t need to run with optimisations.
I use ghci in emacs with a more generalised key shortcut that is “switch to whatever terminal buffer is on the screen, run Ctrl-C interrupt, resend the previous prompt” — similar flow to ghcid.
Discussion in the ATmosphere