Step 0

next

Stack and Code

StackExpression
main

Heap

VariableObject
foldl
FUN(f acc list ->
       case list of {
          Nil -> acc;
          Cons h t ->
             let { newAcc = THUNK(f_? acc h) } in foldl_3 f newAcc t
       })
list1
CON(Cons one nil)
list2
CON(Cons two list1)
list3
CON(Cons three list2)
main
THUNK(sum_1 list3)
nil
CON(Nil)
one
CON(I 1)
plusInt
FUN(x y ->
       case x of {
          I i ->
             case y of {
                I j ->
                   case plus# i j of {
                      x -> let { result = CON(I x) } in result
                   }
             }
       })
sum
FUN(list -> foldl_3 plusInt zero list)
three
CON(I 3)
two
CON(I 2)
zero
CON(I 0)