Created
January 1, 2015 18:26
-
-
Save cyberglot/951adecf6f988ffef272 to your computer and use it in GitHub Desktop.
FP in Haskell - Readability II
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
plus1 :: [Int] -> [Int] | |
plus1 [] = [] | |
plus1 (x:xs) = x + 1 : plus1 xs | |
-- plus1 [0,1,2,3] | |
-- > [1,2,3,4] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just to show off how succinct functional programming can be...
You could even show off how cool the type system can be!
But I'm sure that you made the right choice in choosing a clear and straightforward example for the article.