Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell: where is Data.Numbers.Primes library?

Tags:

haskell

primes

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?

like image 810
Pigna Avatar asked Apr 05 '16 10:04

Pigna


People also ask

Are prime numbers above 100?

The prime numbers from 1 to 200 are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199.


1 Answers

The package you're looking for is called primes.

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

like image 71
Bartek Banachewicz Avatar answered Nov 15 '22 10:11

Bartek Banachewicz