upgrading the ghc version being used by haskell stack

好久不见. 提交于 2019-12-19 09:04:18

问题


I'm trying to update my ghc version installed for haskell stack from version 8.0.2 to 8.2.1 but seems like I am missing something.

[user@localhost ~]$ stack --resolver ghc-8.2.1 setup
stack will use a sandboxed GHC it installed
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec

[user@localhost ~]$ stack ghci
Configuring GHCi with the following packages: 
GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /tmp/ghci7878/ghci-script
Prelude> :q
Leaving GHCi.

I think I need to do some extra step after to update the ghc version of stack but I am not sure.


回答1:


There are 2 options.

temporary solution is every time you have to provide the version of ghc while loading stack.

ghc --resolver ghc-8.2.1 ghci

If you don't give the version of ghc, stack loads the default version.

The second option is permanently configuring the ghc version for stack as default version. Below is the step used for that

configure *resolver: ghc-8.2.1* in the file *.stack/global-project/stack.yaml*

and restart your stack.



来源:https://stackoverflow.com/questions/45533610/upgrading-the-ghc-version-being-used-by-haskell-stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!