[Haskell-cafe] What on earth

Miguel Mitrofanov miguelimo38 at yandex.ru
Thu Sep 20 02:54:08 EDT 2007


> tfoldr (-) 1 [4,3]
> = 4-3-(-1)
> = 2

Erm? You mean "foldr"?

foldr (-) a [x,y,z,t,w] == x - (y - (z - (t - (w - a))))

So, foldr (-) 1 [4,3] == 4 - (3 - 1).

> A similar thing happens with foldr (/) 2 [8,2] = 8.0

8/(2/2) = 8/1 = 8

> I thought foldr \oplus v [] = v

Yeah, that's right.


More information about the Haskell-Cafe mailing list