Created
March 22, 2018 05:19
-
-
Save Allan-Gong/87f822d1f029be55ac5ec21ecd6680da to your computer and use it in GitHub Desktop.
Reverse a list in Haskell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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