【问题标题】:Haskell: where is Data.Numbers.Primes library?Haskell:Data.Numbers.Primes 库在哪里?
【发布时间】:2016-07-25 06:12:14
【问题描述】:

我尝试导入 Data.Numbers.Primes

import Data.Numbers.Primes

runhaskell 给了我:

5.hs:1:8:
    Could not find module `Data.Numbers.Primes'
    Use -v to see a list of the files searched for.

ghci 给了我:

<no location info>:
    Could not find module `Data.Numbers.Primes'
    It is not a module in the current program, or in any known package.

我尝试通过 cabal 安装 Data.Numbers.Primes,但我得到了:

cabal update
...
cabal install Data
cabal: There is no package named 'Data'.
You may need to run 'cabal update' to get the latest list of available
packages.
cabal install Data.Numbers.Primes
cabal: The file does not exist 'Data.Numbers.Primes'.

帮助?

【问题讨论】:

  • Hayoo 是一个很好的搜索引擎。
  • 另外,开始使用堆栈来避免依赖地狱问题。
  • @MichaelLitchard 新手,你能详细说明一下吗?
  • 啊,是的,你走得越远,你就越有可能遇到我们称之为“依赖地狱”的传递性问题。查看堆栈以获取解决方案。 github.com/commercialhaskell/stack/tree/master/doc
  • 使用arithmoi package

标签: haskell primes


【解决方案1】:

您要查找的包名为primes

没有规定包的名称与其顶级模块名称相同。通常,软件包将自己置于任何有意义的地方,但这几乎是任意的。如有疑问,Hackage search 会提供帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-08
    相关资源
    最近更新 更多