[Haskell-cafe] Cabal/primes

michael rice nowgate at yahoo.com
Wed Jun 3 16:35:18 EDT 2009


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

=================

[michael at localhost hackage.haskell.org]$ ghc-pkg hide primes
Writing new package config file... done.
[michael at localhost hackage.haskell.org]$ isPrime 7
bash: isPrime: command not found
[michael at 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 <nowgate at yahoo.com> wrote:

From: michael rice <nowgate at yahoo.com>
Subject: Re: [Haskell-cafe] Cabal/primes
To: "brian" <briand at aracnet.com>
Cc: haskell-cafe at 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

[michael at 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> 

==========
[michael at localhost ~]$ cd .cabal
[michael at 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
[michael at localhost .cabal]$ cd packages
[michael at localhost packages]$ ls -l
total 4
drwxrwxr-x 4 michael michael 4096 2009-06-02 22:14 hackage.haskell.org
[michael at localhost packages]$ cd hackage.haskell.org
[michael at 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
[michael at localhost hackage.haskell.org]$ 
[michael at localhost hackage.haskell.org]$ pwd
/home/michael/.cabal/packages/hackage.haskell.org
[michael at localhost hackage.haskell.org]$ 


=============



--- On Wed, 6/3/09, brian <briand at aracnet.com> wrote:

From: brian <briand at aracnet.com>
Subject: Re: [Haskell-cafe] Cabal/primes
To: "michael rice" <nowgate at yahoo.com>
Cc: haskell-cafe at 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe




      
-----Inline Attachment Follows-----

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090603/b077afd3/attachment.html


More information about the Haskell-Cafe mailing list