Haskell: where is Data.Numbers.Primes library?

冷暖自知 提交于 2019-12-10 13:27:51

问题


I tried importing Data.Numbers.Primes

import Data.Numbers.Primes

runhaskell gave me:

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

ghci gave me:

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

I tried to install Data.Numbers.Primes through cabal, but I got:

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'.

help?


回答1:


The package you're looking for is called primes.

There's no rule that the package will be called as it's top-level module name. Typically, packages put themselves under whatever makes sense, but that's pretty much arbitrary. When in doubt, Hackage search helps.



来源:https://stackoverflow.com/questions/36424064/haskell-where-is-data-numbers-primes-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!