I perform the following foldl
operation
foldl (fn (acc,y) => if acc>y then acc else y+1) 0 [1,3]
So, I expect this to produce me an result of 4
but it produces an output of 3
. What am I missing ?
My trace is something like this:
acc: 0 y: 1
acc: 2 y: 3
and since acc > y, i.e 2>3 it should go into the else branch and return 4 (3+1).