Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dmjio
Created March 8, 2014 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmjio/9438802 to your computer and use it in GitHub Desktop.
Save dmjio/9438802 to your computer and use it in GitHub Desktop.
QuickCheck test
import Test.QuickCheck
fac :: Integer -> Integer
fac n | n < 1 = 1
| otherwise = n * fac (n - 1)
greaterThan0 :: Integer -> Bool
greaterThan0 n = not $ (fac n) < 1
main :: IO ()
main = verboseCheck greaterThan0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment