Why is foldl defined in a strange way in Racket?

前端 未结 4 2024
遇见更好的自我
遇见更好的自我 2020-12-03 00:25

In Haskell, like in many other functional languages, the function foldl is defined such that, for example, foldl (-) 0 [1,2,3,4] = -10.

Thi

4条回答
  •  -上瘾入骨i
    2020-12-03 01:27

    "differently than in any other language"

    As a counter-example, Standard ML (ML is a very old and influential functional language)'s foldl also works this way: http://www.standardml.org/Basis/list.html#SIG:LIST.foldl:VAL

提交回复
热议问题