Description
From flycheck/flycheck#1441:
The Stack build tool has a feature for making self-contained Haskell scripts (documentation). An example script may be:
#!/usr/bin/env stack {- stack script --resolver lts-11.2 --optimize --package attoparsec --package formatting -- -Wall -Wextra -} import qualified Data.Attoparsec.Text as P import qualified Formatting.Formatters as F ...Currently, Flycheck is not useful for such scripts even with the flycheck-haskell package. It ignores the script's options and uses global ones, which usually means a different version of GHC and a different set of packages. The result is that the checker shows some spurious errors in the top lines of the file and doesn't check further.
It would be nice if Flycheck could detect that it's checking a Haskell script which uses Stack, then select the Stack-based checker and make it use the options specified below the shebang in the script.
I think this is best handled on the flycheck-haskell side, so I'm moving it here :)