Question: Question 1 Write a function called extremes in Ocaml / F# , which accepts two parameters: a function ( that acts as a filter )
Question
Write a function called extremes in OcamlF# which accepts two parameters: a function that acts as a "filter" and a list of integers. The function should resolve to a pair of values technically; a tuple containing both the largest and
smallest values in the list, which are also "accepted" by the predicate.
NOTE: Use a "purely" functional form. Eg Use Pattern matching where applicable and no "mutable" types.
Example of the usage: Given the following function invocation of extremes:
let extremes fun &
The value of would be
Of the list values divisible by is the smallest, and is the largest.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
