Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Haskell scripts made with Stack #104

Open
cpitclaudel opened this issue Mar 20, 2020 · 1 comment
Open

Support for Haskell scripts made with Stack #104

cpitclaudel opened this issue Mar 20, 2020 · 1 comment

Comments

@cpitclaudel
Copy link
Member

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 :)

@sergv
Copy link
Contributor

sergv commented Mar 22, 2020

Certainly this is the right place for this issue. If someone wants to work on it - please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants