0

之后cabal install random,我尝试ghc-mod list了,但仍然看不到包。

cabal --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library 

ghc-mod --version
ghc-mod version 5.5.0.0 compiled by GHC 7.10.3 

我现在也尝试添加random-1.1到我的全局 stack.yaml (试图在这里制作一个简单的脚本......)并通过安装stack install random无济于事。

我的文件似乎运行良好runhaskell

4

1 回答 1

2

当您键入stack install random,然后stack ghci使用堆栈运行或安装时,导入成功

> import System.Random  --succeeds

如果你在堆栈之外运行 ghc,它不一定会使用相同的设置。

于 2016-05-06T04:07:42.687 回答