Haskell:Data.Numbers.Primes库在哪里?

Pig*_*gna 6 primes haskell

我尝试导入Data.Numbers.Primes

import Data.Numbers.Primes
Run Code Online (Sandbox Code Playgroud)

runhaskell给了我:

5.hs:1:8:
    Could not find module `Data.Numbers.Primes'
    Use -v to see a list of the files searched for.
Run Code Online (Sandbox Code Playgroud)

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.
Run Code Online (Sandbox Code Playgroud)

我尝试通过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'.
Run Code Online (Sandbox Code Playgroud)

救命?

Bar*_*icz 6

你正在寻找的包被称为primes.

没有规则将包调用为顶级模块名称.通常情况下,软件包将自己置于任何有意义的东西之下,但这几乎是随意的.如果有疑问,Hackage搜索有帮助.