Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recompile Haskell with cabal build showing only warnings

Tags:

haskell

cabal

When I cabal build my projects, warnings (especially with -Wall) are only shown the first time.

On subsequent builds, everything is cached.

I want to see all warnings of my project again.

I could cabal clean and recompile or use cabal build --ghc-options="-fforce-recomp", but that just takes too long.

How do I do a warning-check only as fast as possible?

like image 398
nh2 Avatar asked Sep 05 '12 01:09

nh2


1 Answers

I can speed up compilation by factor ~10 skipping code generation:

cabal build --ghc-options="-fforce-recomp -fno-code"


For only checking individual files, you can use ghc-mod: ghc-mod check -g -Wall file.hs.

like image 139
nh2 Avatar answered Nov 07 '22 08:11

nh2