For SublimeHaskell (and potentially all other editors and similar tools) we need to quickly be able to list all warnings of a cabal project.
cabal build does not show warnings on already compiled modules, so we currently use
cabal build --ghc-options="-fforce-recomp -Wall -fno-code"
to quickly get all warnings of the project. This is obviously slow since all code has to be re-compiled (even though code generation can be skipped).
It would be nice if cabal could use its knowledge of which code has no changes to maintain a cache of warnings and error messages that can be queried super quickly.
We could then add an option cabal build --check that only typechecks the project and prints out all errors/warnings of unchanged files from the cache, so that a no-op typecheck with warnings is instant and can give feedback very quickly or even as you type.
cabal build --check
Related to https://ghc.haskell.org/trac/ghc/ticket/9243