
14 Aug
2007
14 Aug
'07
5:16 p.m.
2007/8/14, Alexteslin
Well, i have tried cons (:) operator but when it passed to foldr doesn't work because cons operator operates first character and then the list but the foldr argument takes a function (a->a->a). Maybe i am missing the point here?
What Aaron was saying was that in this list : 1 : 2 : 3 : 4 : [] A fold replaced the cons (:) by another function (and [] by another constant). Your problem isn't so easy to do with a foldr, a foldl would be easier and a foldr1 or foldl1 even better. Are you sure you can't use one of those other folds ? -- Jedaï