Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created February 4, 2015 11:31
Show Gist options
  • Select an option

  • Save shigemk2/2db1d781209e62c9b611 to your computer and use it in GitHub Desktop.

Select an option

Save shigemk2/2db1d781209e62c9b611 to your computer and use it in GitHub Desktop.
sum' :: (Num a) => [a] -> a
sum' = foldl (+) 0
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