Skip to content

Instantly share code, notes, and snippets.

@Allan-Gong
Created March 22, 2018 05:19
Show Gist options
  • Save Allan-Gong/87f822d1f029be55ac5ec21ecd6680da to your computer and use it in GitHub Desktop.
Save Allan-Gong/87f822d1f029be55ac5ec21ecd6680da to your computer and use it in GitHub Desktop.
Reverse a list in Haskell
-- Reverse a list in Haskell is cool (Pseudo syntax):
-- reverse = foldLeft (flip (:.)) Nil
-- or in formal haskell syntax:
reverse = foldl (flip (:)) []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment