Skip to content

Instantly share code, notes, and snippets.

@tynovsky
Created September 21, 2017 17:26
Show Gist options
  • Save tynovsky/a43a0aaf030f2ee9b667cc2673f5b3ca to your computer and use it in GitHub Desktop.
Save tynovsky/a43a0aaf030f2ee9b667cc2673f5b3ca to your computer and use it in GitHub Desktop.
haskell quickcheck
import Test.QuickCheck
rev :: [a] -> [a]
rev xs = rev' xs [] where
rev' [] acc = acc
rev' (x:xs) acc = rev' xs (x:acc)
prop_revapp :: [Int] -> [Int] -> Bool
prop_revapp xs ys = rev (xs++ys) == rev ys ++ rev xs
main = quickCheck prop_revapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment