问题
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