f (x:y:xs) = foldt1 f (f x y : pairs f xs)foldi1 f [x] = xfoldi1 f (x:xs) = f x (foldi1 f (pairs f xs))
例子.使用Haskell解释器，折叠进行的结构性变换可以用构造一个字符串来展示：λ> foldr (\x y -> concat ["(",x,"+",y,")"]) "0" (map show [1..13])"(1+(2+(3+(4+(5+(6+(7+(8+(9+(