You want to make a pull request to a Haskell project, which requires that each commit in your PR compiles fine individually.
Here is an easy, automated and fast way to check it:
git rebase --interactive HEAD~~~ --exec "! grep 'error:' <(stack ghci mylibrary:lib --ghci-options='-e 1' 2>&1)"