Could you please answer this question:
For this two exercises, develop and test a Haskell function :
1).The time of day can be represented by a tuple (hours,minutes,m) where m indicates either “AM” or “PM”. Develop a Boolean Haskell function comesBefore that takes two time-of-day tuples and determines whether the first is an earlier time than the second. (Note: Consider midnight and noon.)
2)Develop a Haskell function
minf :: (Int -> Int) -> Int
such that minf g returns the smallest integer m such that 0 <= m <= 10000000 and g m == 0 (if such an integer exists).
Function minf is a higher-order function
It takes ONE argument g and returns an Int
g is itself a function that takes an Int and returns an Int
A call minf g searches the range from 0 through 10,000,000 for the smallest integer m that makes g m == 0
There might not be such an integer, so you have to take this into account.
Here is one example of a g
g :: Int -> Int g n | n > 1000 = 0 g n = n
Then
minf g == 1001