Reputation: 45
I'm compiling my program as: ghc -Wall foo.hs
and I get some helpful warnings:
foo.hs:14:1: Warning:
Top-level binding with no type signature: main :: IO ()
Now, if I immediately re-run ghc -Wall foo.hs
, I get no warnings. If I delete the intermediate files foo.o
and foo.hi
, then run ghc -Wall foo.hs
, the warnings reappear.
Is this intended behaviour? Can I make it so warnings are always displayed without having to delete intermediate files?
Upvotes: 0
Views: 80
Reputation: 9414
If the results of compilation (.hi
and .o
) already exist then GHC will not recompile the .hs
. GHC only emits the warning when it compiles (or typechecks) the .hs
.
Perhaps you could use ghc -fforce-recomp foo.hs
to force recompiling. (If you just want to typecheck then it's quicker to useghc -fforce-recomp -fno-code foo.hs
but there are some warnings that -fno-code
doesn't catch.)
Upvotes: 2