27.12.2013 Views

Wearing the hair shirt Wearing the hair shirt - Microsoft Research

Wearing the hair shirt Wearing the hair shirt - Microsoft Research

Wearing the hair shirt Wearing the hair shirt - Microsoft Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Quickcheck<br />

propRev :: [Int] -> Bool<br />

propRev xs = reverse (reverse xs) == xs<br />

propRevApp :: [Int] -> [Int] -> Bool<br />

propRevApp xs ys = reverse (xs++ys) ==<br />

reverse ys ++ reverse xs<br />

ghci> quickCheck propRev<br />

OK: passed 100 tests<br />

ghci> quickCheck propRevApp<br />

OK: passed 100 tests<br />

Quickcheck (which is just a Haskell 98 library)<br />

Works out how many arguments<br />

Generates suitable test data<br />

Runs tests

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!