Skip to content

Instantly share code, notes, and snippets.

@puffnfresh
Created January 30, 2014 16:12
Show Gist options
  • Save puffnfresh/8712148 to your computer and use it in GitHub Desktop.
Save puffnfresh/8712148 to your computer and use it in GitHub Desktop.
This should fully specify reverse.
-- |
-- prop> \xs -> f (f xs) == xs
-- prop> \xs ys -> f ys ++ f xs == f (xs ++ ys)
f :: [a] -> [a]
f = foldl (flip (:)) []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment