Ask Question

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.

+5
Answers (1)
  1. 6 October, 16:02
    0
    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
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write and test the definition of a haskell function 'largest', which finds the largest element of a list, but is implemented using ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers