Last active
November 15, 2015 20:43
-
-
Save andrewharmellaw/e2562f2d93352d2e82dd to your computer and use it in GitHub Desktop.
Trace of a simple foldLeft
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
foldLeft(List(1,2,3), 0) (_ + _) | |
foldLeft(Cons(1, Cons(2, Cons(3, Nil))), 0) (_ + _) | |
foldLeft(Cons(2, Cons(3, Nil)), (0 + 1)) (_ + _) | |
foldLeft(Cons(3, Nil), ((0 + 1) + 2)) (_ + _) | |
foldLeft(Nil, (((0 + 1) + 2) + 3)) (_ + _) | |
(((0 + 1) + 2) + 3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment