Hobby-hacking Eric

2009-01-08

fold diagram revisited?

z
|
f----1----f
| : |
f----2----f
| : |
f----3----f
| : |
f----4----f
| : |
f----5----f
: |
[] z


1 comment:

kowey said...

One thing that I just now understood tripped me up was looking at this definition (foldl f z [] = z), looking back at the diagram and then doing a double-take (wait, that can't be right? how did z get down there?).

Of course, that's because I forgot that z here is just the parameter to that fold case, and not necessarily the z you pass in when you call fold on a list.