The output of
stack ghc -- --version
is
The Glorious Glasgow Haskell Compilation System, version 7.10.3
I want to upgrade to GHC 8.
How can I tell Stack to upgrade GHC?
In its default configuration, Stack will simply ignore any system GHC installation and use a sandboxed GHC that it has installed itself. You can find these sandboxed GHC installations in the ghc-* directories in the stack path --programs directory.
Stack installs the Stackage libraries in ~/. stack and any project libraries or extra dependencies in a . stack-work directory within each project's directory. None of this should affect any existing Haskell tools at all.
stack ghci allows you to load components and files of your project into ghci . It uses the same TARGET syntax as stack build , and can also take options like --test , --bench , and --flag . Similarly to stack build , the default is to load up ghci with all libraries and executables in the project.
The version number of your copy of GHC can be found by invoking ghc with the --version flag (see Verbosity options). The compiler version can be tested within compiled code with the MIN_VERSION_GLASGOW_HASKELL CPP macro (defined only when CPP is used).
User dysfun from the IRC answered my question so I will post it here for posterity.
To update GHC that's used to compile a project, go to the project's stack.yaml
file.
In there is the resolver field. Update that accordingly. Some examples:
resolver: ghc-8.0.2
resolver: lts-9.0
resolver: nightly-2015-09-21
For my case, I learned from this webpage that resolver lts-9.0
uses GHC 8.0.2.
Here's more on Stack's resolvers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With