why foldl is not short circuiting with andFn function?
问题 My understanding is that foldl and foldr executes like : foldl f a [1..30] => (f (f (f ... (f a 1) 2) 3) ... 30) and foldr f a [1..30] => (f 1 (f 2 (f 3 (f ....(f 30 a)))))..) so.. foldr (&&) False (repeat False) can shortciruit as outermost f sees (&&) False ((&&) False (....)) sees first argument as false and does not need to evaluate the second argument (which is a large thunk). so what happens with andFn :: Bool -> Bool -> Bool andFn _ False = False andFn x True = x and foldl andFn True