升级haskell堆栈使用的ghc版本 [英] upgrading the ghc version being used by haskell stack

查看:327
本文介绍了升级haskell堆栈使用的ghc版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将为haskell堆栈安装的ghc版本从8.0.2更新到8.2.1,但似乎我缺少了一些东西.

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.

我想在更新ghc版本的堆栈后需要做一些额外的步骤,但是我不确定.

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

推荐答案

有2个选项.

临时解决方案是每次在加载堆栈时必须提供ghc版本.

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

ghc --resolver ghc-8.2.1 ghci

如果您不提供ghc的版本,则堆栈会加载默认版本.

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. Below is the step used for that

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

然后重新启动堆栈.

这篇关于升级haskell堆栈使用的ghc版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆