Got it working. I downloaded two packages, primes and Numbers. Since Numbers has the three functions I want to use, primes, isPrime and isProbablyPrime, how do I uninstall the primes package so there won't be a conflict?
Michael ================= [mich...@localhost hackage.haskell.org]$ ghc-pkg hide primes Writing new package config file... done. [mich...@localhost hackage.haskell.org]$ isPrime 7 bash: isPrime: command not found [mich...@localhost hackage.haskell.org]$ ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> :m + Data.Numbers.Primes Prelude Data.Numbers.Primes> isPrime 7 Loading package syb ... linking ... done. Loading package base-3.0.3.0 ... linking ... done. Loading package old-locale-1.0.0.1 ... linking ... done. Loading package old-time-1.0.0.1 ... linking ... done. Loading package random-1.0.0.1 ... linking ... done. Loading package Numbers-0.2.1 ... linking ... done. True Prelude Data.Numbers.Primes> take 10 primes [2,3,5,7,11,13,17,19,23,29] Prelude Data.Numbers.Primes> --- On Wed, 6/3/09, michael rice <nowg...@yahoo.com> wrote: From: michael rice <nowg...@yahoo.com> Subject: Re: [Haskell-cafe] Cabal/primes To: "brian" <bri...@aracnet.com> Cc: haskell-cafe@haskell.org Date: Wednesday, June 3, 2009, 3:46 PM This is working differently than it did last night, when at least import was working. Michael [mich...@localhost ~]$ ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> import Data.Numbers.Primes Could not find module `Data.Numbers.Primes': it was found in multiple packages: Numbers-0.2.1 primes-0.1.1 Prelude> :m + Data.Numbers.Primes Could not find module `Data.Numbers.Primes': it was found in multiple packages: Numbers-0.2.1 primes-0.1.1 Prelude> Data.Numbers.Primes> :browse <interactive>:1:21: parse error on input `:' Prelude> isPrime 3525266 <interactive>:1:0: Not in scope: `isPrime' Prelude> ========== [mich...@localhost ~]$ cd .cabal [mich...@localhost .cabal]$ ls -l total 20 -rw-rw-r-- 1 michael michael 1729 2009-06-02 18:59 config drwxrwxr-x 4 michael michael 4096 2009-06-02 22:14 lib drwxrwxr-x 2 michael michael 4096 2009-06-02 19:05 logs drwxrwxr-x 3 michael michael 4096 2009-06-02 18:59 packages drwxrwxr-x 3 michael michael 4096 2009-06-02 19:05 share [mich...@localhost .cabal]$ cd packages [mich...@localhost packages]$ ls -l total 4 drwxrwxr-x 4 michael michael 4096 2009-06-02 22:14 hackage.haskell.org [mich...@localhost packages]$ cd hackage.haskell.org [mich...@localhost hackage.haskell.org]$ ls -l total 12464 -rw------- 1 michael michael 11735040 2009-06-02 22:14 00-index.tar -rw------- 1 michael michael 992994 2009-06-02 22:14 00-index.tar.gz -rw-rw-r-- 1 michael michael 418 2009-06-02 22:14 build-reports.log drwxrwxr-x 3 michael michael 4096 2009-06-02 22:14 Numbers drwxrwxr-x 3 michael michael 4096 2009-06-02 19:05 primes [mich...@localhost hackage.haskell.org]$ [mich...@localhost hackage.haskell.org]$ pwd /home/michael/.cabal/packages/hackage.haskell.org [mich...@localhost hackage.haskell.org]$ ============= --- On Wed, 6/3/09, brian <bri...@aracnet.com> wrote: From: brian <bri...@aracnet.com> Subject: Re: [Haskell-cafe] Cabal/primes To: "michael rice" <nowg...@yahoo.com> Cc: haskell-cafe@haskell.org Date: Wednesday, June 3, 2009, 10:46 AM Prelude> :m + Data.Numbers.Primes Prelude Data.Numbers.Primes> :browse isPrime :: Integer -> Bool isProbablyPrime :: (System.Random.RandomGen g) => Integer -> g -> (Bool, g) primes :: [Integer] Prelude Data.Numbers.Primes> isPrime 3525266 Loading package syb ... linking ... done. Loading package base-3.0.3.0 ... linking ... done. Loading package old-locale-1.0.0.1 ... linking ... done. Loading package old-time-1.0.0.1 ... linking ... done. Loading package random-1.0.0.1 ... linking ... done. Loading package Numbers-0.2.1 ... linking ... done. False Prelude Data.Numbers.Primes> On Jun 3, 2009, at 6:57 AM, michael rice wrote: > OK, I downloaded Numbers. Still missing the three functions I wanted, which > are primes, isPrime, and isProbablyPrime. How do I get these? > > Michael > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -----Inline Attachment Follows----- _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe