
10 Sep
2010
10 Sep
'10
11:13 p.m.
Which of these would be more costly for a long list? f :: [Int] -> [Int] f [x] = [x] f (x:xs) = x + (head xs) : f xs f :: [Int] -> [Int] f [x] = [x] f (x:y:xs) = x + y : f (y:xs) Michael