I have a function called bounds1Accum. this function works great
bounds1Accum :: [Integer] -> Integer -> Integer -> (Integer, Integer)
bounds1Accum l min max = (minimum (min:l), maximum (max:l))
What I am having problems with is I need another function called bounds1 which will take in just a list and return a min max pair. This function is supposed to wrap around bounds1accum and check to first see if the list being passed to it is empty or not. if the list is empty it will return Nothing or it will Just return the result of calling the bounds1Accum function.
I need two cases and for my signature I have
bounds1 :: [l] -> Maybe(min,max)
bounds1 [] = Nothing (which I am unsure if this will be correct)
then the 2nd case is where I am stumped I originally had
bounds1 l min max = if null l then Nothing else Just $ bounds1 bounds1Accum min max
but this does not even compile so if anyone can offer suggestions or another way I can look at this problem it would be great. This is for an assignment so I do not want the answer but more so just guidance or help solving the problem. Thank you