5 ms·
>> fold () x it should be fold () 1 x or foldr1 () x or foldl1 () x of course according to Guy Steele, fodl and foldr are considered harmful :)
by fedvasu 13y ago
>> fold () x
it should be fold () 1 x or foldr1 () x
or foldl1 () x
of course according to Guy Steele, fodl and foldr are considered harmful :)
- kd0amg 13y agoIt's really cons lists that are harmful -- foldl and foldr are just ways to operate on them. GP's example would work fine with conc trees and a divide-and-conquer reduce instead.
- bodhi 13y agoI don't really understand, can you explain more? I should have written in my comment that I'm a Haskell beginner...