[Haskell-cafe] Installing and running QuickCheck

Daniel Fischer daniel.is.fischer at web.de
Tue Apr 12 04:09:52 EDT 2005


Hm,

no instance Arbitrary Char is provided in the QuickCheck modules that came 
with my hugs or ghc. Probably the author just forgot to import Data.Char. Try 
inserting that in QuickCheck.hs.

Hope that works,
Daniel

Am Samstag, 9. April 2005 21:10 schrieb Adam Wyner:
> Hi,
>
> I'd like to use QuickCheck for testing Haskell programs.  I'm using Hugs
> in Windows.  I'm a newbie to Haskell.
>
> Just running QuickCheck.hs itself, which comes with the Hugs98
> libraries, I get an error message and the Monad command line, which
> indicates that quickcheck didn't load.
>
> ERROR "C:\Program Files\Hugs98/libraries\QuickCheck.hs":147 - Undefined
> variable  "chr"
> Monad>
>
> Here is the line in QuickCheck.hs which leads to the error.
>
> instance Arbitrary Char where
>    arbitrary     = choose (32,255) >>= \n -> return (chr n)
>    coarbitrary n = variant (ord n)
>
> This code is from the website:
>
> http://www.cs.chalmers.se/~rjmh/QuickCheck/QuickCheck.hs
>
> I tested it with the following module, as per the instructions in on
> QuickCheck's manual page:
> ----
> module TestQuickCheck
>
> where
>
> import QuickCheck
>
> prop_RevRev xs = reverse (reverse xs) == xs
>    where types = xs::[Int]
> ----
> Loading just this, I get the same error:
>
> Prelude> :l TestQuickCheck
> ERROR "C:\Program Files\Hugs98/libraries\QuickCheck.hs":147 - Undefined
> variable
>   "chr"
> Monad>
>
> I know others report using QuickCheck, so this problem must have been
> resolved.
>
> Also, I guess the quickcheck script is for Linux alone?  Any scripts for
> Hugs in Windows?
>
> Cheers,
> Adam



More information about the Haskell-Cafe mailing list