简体   繁体   English

升级haskell堆栈使用的ghc版本

[英]upgrading the ghc version being used by haskell stack

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. 我正在尝试将从8.0.2版本安装的haskell堆栈的ghc版本更新到8.2.1但似乎我错过了一些东西。

[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. 我想我需要做一些额外的步骤来更新堆栈的ghc版本,但我不确定。

There are 2 options. 有2个选项。

temporary solution is every time you have to provide the version of ghc while loading stack. 临时解决方案是每次在加载堆栈时都必须提供ghc的版本。

ghc --resolver ghc-8.2.1 ghci

If you don't give the version of ghc, stack loads the default version. 如果您不提供ghc的版本,则堆栈会加载默认版本。

The second option is permanently configuring the ghc version for stack as default version. 第二个选项是将堆栈的ghc版本永久配置为默认版本。 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. 并重新启动堆栈。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM