
29 Jun
2006
29 Jun
'06
10:38 a.m.
On 6/27/06, Udo Stenzel
Neil Mitchell wrote:
Or if you don't want to go for a fold next, in a style more similar to the original:
maximum [] = undefined maximum [x] = x maximum (a:b:xs) = maximum (max a b : xs)
It even reproduces the stack overflow, though for a different reason.
How about this: maximum (a:b:xs) = maximum ((: xs) $! max a b) --ihope