clueless GHCI user wishes to load QuickCheck

shae@webwitches.com shae@webwitches.com
Tue, 11 Mar 2003 19:12:34 +0100


--=-=-=

nr@eecs.harvard.edu (Norman Ramsey) writes:

> Can anyone help me figure out how to load QuickCheck into GHCI?
> QuickCheck is included in my Debian package, but my attempts
> at loading it are bootless:
>
> Prelude> :load QuickCheck
<snip>
> Any advice, anyone?

You need to load a source file that imports QuickCheck.
With the attached file and ghci,

Prelude> :l /path/to/ProtoQuickCheck.hs
then:
*ProtoQuickCheck> quickCheck prop_RevUnit

The first QuickCheck paper is an excellent guide to using QuickCheck.


--=-=-=
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=ProtoQuickCheck.hs
Content-Transfer-Encoding: base64
Content-Description: some transcribed code from the original QuickCheck paper

bW9kdWxlIFByb3RvUXVpY2tDaGVjayB3aGVyZQppbXBvcnQgUXVpY2tDaGVjawppbXBvcnQg
TGlzdAoKLS0gCSRJZDogUHJvdG9RdWlja0NoZWNrLmhzLHYgMS4yIDIwMDMvMDMvMTEgMTg6
MDk6MTQgc2hhZSBFeHAgJAkKCnByb3BfUmV2VW5pdCA6OiBbSW50XSAtPiBCb29sCnByb3Bf
UmV2VW5pdCB4ID0gCiAgICByZXZlcnNlIFt4XSA9PSBbeF0KCnByb3BfUmV2QXBwIDo6IFtJ
bnRdIC0+IFtJbnRdIC0+IEJvb2wKcHJvcF9SZXZBcHAgeHMgeXMgPSAKICAgIHJldmVyc2Ug
KHhzICsrIHlzKSA9PSByZXZlcnNlIHlzICsrIHJldmVyc2UgeHMKCnByb3BfUmV2UmV2IDo6
IFtJbnRdIC0+IEJvb2wKcHJvcF9SZXZSZXYgeHMgPSAKICAgIHJldmVyc2UgKHJldmVyc2Ug
eHMpID09IHhzCgooZiA9PT0gZykgeCA9IGYgeCA9PSBnIHgKCnByb3BfQ29tcEFzc29jICAg
ICAgIDo6IChJbnQgLT4gSW50KSAtPiAoSW50IC0+IEludCkgIC0+IChJbnQgLT4gSW50KSAt
PiBJbnQgLT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JvcF9Eb3VibGVDeWNsZTIgICAgICA6OiBbSW50XSAtPiBJbnQgLT4gUHJv
cGVydHkKcHJvcF9Eb3VibGVDeWNsZTIgeHMgbiA9IAogICAgbm90IChudWxsIHhzKSAmJiBu
ID49IDAgPT0+IAogICAgICAgIHRha2UgbiAoY3ljbGUgeHMpID09IHRha2UgbiAoY3ljbGUg
KHhzICsrIHhzKSkKCi0tIGNvdXJ0ZXN5IEhlZmZhbHVtcApvcmRlcmVkIFtdICAgICAgID0g
IFRydWUKb3JkZXJlZCBbeF0gICAgICA9ICBUcnVlCm9yZGVyZWQgKHg6eTp4cykgPSAgeDw9
eSAmJiBvcmRlcmVkICh5OnhzKQoKLS0gTG9jYWwgVmFyaWFibGVzOgotLSBjb21waWxlLWNv
bW1hbmQ6ICIuL3F1aWNrY2hlY2sgK25hbWVzIFByb3RvUXVpY2tDaGVjay5ocyIKLS0gRW5k
OgoKbWFpbiA9IHB1dFN0ciAieW8i
--=-=-=

-- 
Shae Matijs Erisson - 2 days older than RFC0226
#haskell on irc.freenode.net - We Put the Funk in Funktion
10 PRINT "HELLO" 20 GOTO 10 ; mapM_ putStrLn $ fix ("hello":)

--=-=-=--