Created
June 3, 2015 15:51
-
-
Save ijoshsmith/70e91a1daae2fa913a90 to your computer and use it in GitHub Desktop.
foldr vs. foldl
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
> 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