我是 Haskell 的新手,它的包有问题。
我想导入 System.Random 但是
Could not find module `System.Random'
然后我尝试导入系统但是
Could not find module `System'.
It is a member of the hidden package `haskell98-2.0.0.0'.
我试图搜索这个问题,但这些解决方案仍然不起作用。
如this说,我尝试使用 MacPort 在我的 Mac OS X 上安装 cabal,但是
Error: The following dependencies were not installed: ghc Error: Status 1 encountered during processing.
我已经安装了Haskell Platform并且可以在命令行中使用 ghci。
GHCi,版本 7.2.1
然后我尝试使用
ghc-pkg expose haskell98-2.0.0.0
如this one说。但这一次,我什至不能运行 ghci。
Top level:
Ambiguous interface for `Prelude':
it was found in multiple packages: base haskell98-2.0.0.0
那么,不使用 cabal 我能做什么呢?
最佳答案
System.Random
模块属于 the random
package ,即 no longer included with GHC as of version 7.2.1 .
我不确定如何处理您的 Cabal 问题,因为我不熟悉 Mac OS X,但我建议先让它工作。安装 random
那么使用 Cabal 应该是微不足道的。
作为一种可能的解决方法,您可能需要考虑使用旧版本的 GHC。
关于Haskell 找不到模块 `System',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7265550/