我在 Windows 10 上使用 Haskell 以及 Stack 和 Atom。有时,我喜欢编写一个独立的程序.hs
文件来玩各种东西。当我这样做时,我更喜欢使用 GHCi 与其进行交互。
通常,我从 Git Bash 启动它:
$ stack ghci --color never
从这里,我可以添加模块:
Prelude> :m +Data.Vector.Unboxed
Prelude Data.Vector.Unboxed>
然而,在 Atom 中,我在使用该特定包时遇到了问题:
- 开放原子
- 创建一个新的
.hs
file
- 添加以下内容并点击Save:
文件内容:
module Ploeh where
import qualified Data.Vector.Unboxed as V
当我保存文件时,我在 Atom 中收到以下错误消息:
Failed to load interface for `Data.Vector.Unboxed'
Use -v to see a list of the files searched for.
如果我删除导入Data.Vector.Unboxed
,错误消息消失。
这个问题特别发生在Data.Vector.Unboxed
。其他模块要么在 GHCi 和 Atom 中一致存在,要么在两个环境中一致缺失,但特别是此模块的行为不一致。
我认为 Atom 使用的引擎与使用的“全局”配置不同stack ghci
,但如果是这样,它在哪里,我可以配置/更新它吗?为什么有区别?
我正在使用以下 Atom 包:
-
自动完成-haskell 1.0.1
-
Haskell-ghc-mod 2.2.2
-
艾德哈斯克尔 2.2.2
-
伊德哈斯克尔阴谋 2.1.0
-
语言-haskell 1.17.2
Atom 本身的版本是 1.23.2 x64。
$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0
我相信一切都是最新的。
我读了https://atom-haskell.github.io/core-packages/haskell-ghc-mod/#using-with-stack https://atom-haskell.github.io/core-packages/haskell-ghc-mod/#using-with-stack以及文档的其他部分,看看我是否能找到一些有用的信息,但我未能找到一些可以启发我的东西。