Left and Right Folding over an Infinite list

前端 未结 5 1524
北荒
北荒 2020-12-07 14:03

I have issues with the following passage from Learn You A Haskell (Great book imo, not dissing it):

One big difference is that right folds work on i

5条回答
  •  抹茶落季
    2020-12-07 14:42

    Your understanding is correct. I wonder if the author is trying to talk about Haskell's lazy evaluation system (in which you can pass an infinite list to various functions not including fold, and it will only evaluate however much is needed to return the answer). but I agree with you that the author isn't doing a good job describing anything in that paragraph, and what it says is wrong.

提交回复
热议问题