[Haskell-beginners] QuickCheck
Thomas Friedrich
info at suud.de
Sat May 23 23:47:06 EDT 2009
Hi folks,
I did the following and now it works. I had a closer look at my ghc-pkg
list (thanks for the tip), which looked like the following:
$ ghc-pkg list
/usr/lib/ghc-6.10.3/./package.conf:
Cabal-1.6.0.3, Chart-0.10.3, HUnit-1.2.0.3, QuickCheck-1.2.0.0,
X11-1.4.5, array-0.2.0.0, base-3.0.3.1, base-4.1.0.0,
bytestring-0.9.1.4, cairo-0.10.1, containers-0.2.0.1,
data-accessor-0.2.0.2, data-accessor-template-0.2.1.1,
directory-1.0.0.3, (dph-base-0.3), (dph-par-0.3),
(dph-prim-interface-0.3), (dph-prim-par-0.3), (dph-prim-seq-0.3),
(dph-seq-0.3), extensible-exceptions-0.1.1.0, filepath-1.1.0.2,
gconf-0.10.1, (ghc-6.10.3), ghc-prim-0.1.0.0, glade-0.10.1,
glib-0.10.1, gtk-0.10.1, gtkglext-0.10.1, gtksourceview2-0.10.1,
haddock-2.4.2, haskell-src-1.0.1.3, haskell98-1.0.1.0, hpc-0.5.0.3,
html-1.0.1.2, integer-0.1.0.1, mtl-1.1.0.2, network-2.2.1,
old-locale-1.0.0.1, old-time-1.0.0.2, packedstring-0.1.0.1,
parallel-1.1.0.1, parsec-2.1.0.1, pretty-1.0.1.0, process-1.0.1.1,
random-1.0.0.1, regex-base-0.72.0.2, regex-compat-0.71.0.1,
regex-posix-0.72.0.3, rts-1.0, soegtk-0.10.1, stm-2.1.1.2,
svgcairo-0.10.1, syb-0.1.0.1, template-haskell-2.3.0.1, time-1.1.3,
transformers-0.1.4.0, unix-2.3.2.0, utf8-string-0.3.4,
utility-ht-0.0.5.1, xhtml-3000.2.0.1, xmonad-0.8.1,
xmonad-contrib-0.8.1
/home/thomas/.ghc/i386-linux-6.10.3/package.conf:
Diff-0.1.2, QuickCheck-2.1.0.1, binary-0.5.0.1,
data-accessor-monads-fd-0.2, derive-0.1.4, dotgen-0.2,
fingertree-0.0, ghc-paths-0.1.0.5, haskell-lexer-1.0,
monads-fd-0.0.0.1, pointedlist-0.3.3, pureMD5-0.2.4,
regex-base-0.93.1, regex-tdfa-1.0.0, rosezipper-0.1, split-0.1.1,
terminfo-0.3.0.2, uniplate-1.2.0.3, unix-compat-0.1.2.1,
vty-3.1.8.4, yi-0.6.0
I think because I installed yi, I must have also ended up with the
QuickCheck-2.1.0.1 package. In this package there is NO `generate`, no
`verboseCheck` and other functions available. (Why?? Does anyone
know?) Also there is no QuickCheck.Batch.
Simply hiding the package solved the problem, by
ghc-pkg hide QuickCheck-2.1.0.1
Now, I can also use the Batch module.
Does anyone know why the now version of QuickCheck is not compatible
with the old one?
Best,
Thomas
Thomas Friedrich wrote:
> Hi Lee,
>
> I do have GHC and no, I seem to not have it.
>
> $ ghc-pkg list | grep -i quickcheck
> Cabal-1.6.0.3, Chart-0.10.3, HUnit-1.2.0.3, QuickCheck-1.2.0.0,
> Diff-0.1.2, QuickCheck-2.1.0.1, binary-0.5.0.1,
>
>
> When I am in ghci, I have the following options:
>
> Prelude> :m +Test.QuickCheck
> Test.QuickCheck Test.QuickCheck.Function
> Test.QuickCheck.Monadic Test.QuickCheck.Property
> Test.QuickCheck.Test
> Test.QuickCheck.Arbitrary Test.QuickCheck.Gen
> Test.QuickCheck.Poly Test.QuickCheck.State
> Test.QuickCheck.Text
> Prelude> :m +Test.QuickCheck
>
> But no Test.QuickCheck.Batch
>
> :(
>
> Cheers,
> Thomas
>
>
> Lee Duhem wrote:
>> On Sun, May 24, 2009 at 11:08 AM, Thomas Friedrich <info at suud.de> wrote:
>>
>>> Hallo everyone,
>>>
>>> I am currently playing around with the QuickCheck library. I came
>>> across
>>> the
>>>
>>> Test.QuickCheck.Batch
>>>
>>> module a couple of times. I don't seem to have this module installed?
>>> Where can I get it and how do I install it?
>>>
>>
>> If you use GHC, you already have it, try
>> ghc-pkg list | grep -i quickcheck
>>
>>
>>> I also would like to invoke the following in ghci.
>>>
>>> generate 10 (System.Random.mkStdGen 1) arbitrary :: [Int]
>>>
>>> However, the function `generate` doesn't get imported when importing
>>> QuickCheck, and I just cannot find out which module this one would
>>> be in.
>>>
>>
>> In GHCi, you need import Test.QuickCheck or Debug.QuickCheck before
>> you use generate.
>>
>>
>>> I came to the conclusion that `generate` is just not the best word
>>> for a
>>> google search :(
>>>
>>
>> Just check the document of GHC libraries:
>> http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
>> http://www.haskell.org/ghc/docs/latest/html/libraries/QuickCheck/Test-QuickCheck.html
>>
>>
>> lee
>>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
More information about the Beginners
mailing list