danco8m9aLiseomie danco8m9aLiseomie
  • 15-12-2016
  • Computers and Technology
contestada

Write and test the definition of a haskell function 'largest', which finds the largest element of a list, but is implemented using higher-order functions and/or operator sections as appropriate.

Respuesta :

miden miden
  • 15-12-2016
largest :: [a] -> (a -> a -> Ordering) -> a largest (x:xs) cmp = go x xs where go largest [] = largest go largest (x:xs) = case cmp largest x of LT -> go x xs _ -> go largest xs

Answer Link

Otras preguntas

how is mass transit in cities a possible solution tk urban air pollution?
Data are drawn from a symmetric and bell shaped distribution with a mean of 120 and a standard deviation of 5. There are 900 observations in the data set. What
Marika and Freddy sold 70 homes for Ron Realty. If Marika sold 2.5 times as many homes as Freddy, how many homes did each sell?
Which equation has the same y-intercept as y=4x-3?a. y-3=x              b. y=8x+3    c. 3-y=4x      d. y=-3+8xWhich of the following is the equation of the line
Find Domain of the functionsquare root of (x-8)/x(x-9)
Data are drawn from a symmetric and bell shaped distribution with a mean of 120 and a standard deviation of 5. There are 900 observations in the data set. What
Data are drawn from a symmetric and bell shaped distribution with a mean of 120 and a standard deviation of 5. There are 900 observations in the data set. What
how is mass transit in cities a possible solution tk urban air pollution?
(10y^3+20y^2+55y)/5y
find an equivalent expression without parentheses -(50x-15y+15)=