Skip to content

Instantly share code, notes, and snippets.

@ijoshsmith
Created June 3, 2015 15:51
Show Gist options
  • Save ijoshsmith/70e91a1daae2fa913a90 to your computer and use it in GitHub Desktop.
Save ijoshsmith/70e91a1daae2fa913a90 to your computer and use it in GitHub Desktop.
foldr vs. foldl
> foldr (-) 0 [3, 2, 1]
2
> (3 - (2 - (1 - 0)))
2
> foldl (-) 0 [3, 2, 1]
-6
> (((0 - 3) - 2) - 1)
-6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment