-
Notifications
You must be signed in to change notification settings - Fork 841
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
stack typecheck #977
Comments
I don't believe this is accurate. Instead, it appears that Cabal, when configure, chokes on these arguments. Consider these three different configure attempts with the options specified:
In other words: Cabal is trying use those options during configuration to generate an object file, and |
OK, that diagnosis sounds more right. In any case, since |
As more of a side note, So, the question is whether users would expect a "typecheck" command to include those kinds of errors. They would show up when running |
Here's the GHC bug for this infelicity: https://ghc.haskell.org/trac/ghc/ticket/10600 Personally I think it's OK for those errors to be missing. It's just a gotcha due to an underlying bug. |
This would be great for reducing the debugging time. In a large project with many dependencies, I have to wait minutes to recompile everything if I edit a core module. I don't think "stack ghci" quite fills that gap because it misses the executables. |
True! If only we could load multiple main files and even packages into ghci - https://ghc.haskell.org/trac/ghc/ticket/10827 I'd certainly merge a PR for it |
Just saw this issue referenced on Reddit and wanted to comment that the underlying GHC issue has been fixed: https://ghc.haskell.org/trac/ghc/ticket/10600 Unclear to me if it made it into 8.2 or it's just ready for 8.4 |
This would be very nice if incorporated into the behaviour of |
I think it'd make sense to have this be a flag rather than a command. Here's why:
So, I propose that it be |
I'm using this for now for fast typechecking: That just loads everything into ghci and evaluates "1", or fails if typechecking fails. Especially useful in combination with git:
This typechecks each individual commit I have locally on top of master. (See here for more info on rebase, and here for setting |
Any updates on this issue? Is this something a beginner could work on? |
No updates, and yes, suitable for a beginner. I believe ghcid does something very similar to this — it may be worth investigating that with @ndmitchell. One complication may concern template-haskell; I'm not sure how to handle that when using |
|
Oh, ok — thanks. I've also just noticed that backpack allows typechecking modules that have only signatures (i.e. no code) and so this may be more complicated than it would appear. Note that stack doesn't yet support backpack, but backpack ought to be considered when implementing this change. |
#4545 (in progress) changes stack's behaviour regarding '.hi' files |
Stack should have a mode similar to build which only typechecks files. This can be done (with recomp avoidance) by passing
-fwrite-interface -fno-code
to GHC. I can't use--ghc-options
to do this today because Stack passes those flags to build the Setup script, which obviously needs to be built for real (it is a bit odd that Stack always builds a setup script).The text was updated successfully, but these errors were encountered: