I would like to generate an .hi interface file and only that (no object file, no code generation at all).
.hi
I tried
ghc -
Around 2014, there was an option added to GHC specifically for this. Now, you can invoke:
ghc -fno-code -fwrite-interface ...
It actually speeds up compilation by about a quarter in some cases.