
27 Jun
2006
27 Jun
'06
4:52 a.m.
Hi,
mymax [] = undefined mymax (x:xs) = f x xs where f x [] = x f x (y:ys) | y > x = f y ys | otherwise = f x ys
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) Thanks Neil