 myMinimumBy takes a comparison function and a list and returns the least
-- element of the list based on the last value that the com- parison returned LT
-- for.
myMinimumBy :: (a -> a -> Ordering) -> [a] -> a
myMinimumBy f (x:xs) = foldr (\x y -> case f x y of
                                 LT -> x
                                 _ -> y) x xs

myMinimumBy :: (a -> a -> Ordering) -> [a] -> a
myMinimumBy f (x:xs) = foldr (\x y -> case f x y of
                                 LT -> x
                                 _ -> y) x xs
myMinimumBy f (x:xs) = foldr (\x y -> case f x y of
                                 LT -> x
                                 _ -> y) x xs