Created
February 4, 2015 11:29
-
-
Save shigemk2/c09a538fd5d7a8253a84 to your computer and use it in GitHub Desktop.
This file contains 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
sum' :: (Num a) => [a] -> a | |
sum' xs = foldl (\acc x -> acc + x) 0 xs | |
main = do | |
print $ sum' [1,2,3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment