Task

Create a function that returns the maximum value in a provided set of values,

where the number of values may not be known until run-time.




open list
 
findBy p (x::xs) = foldl (\x y | p x y -> x | else -> y) x xs
maximum = findBy (>)
 
maximum [1..10]