I want to implement minimum with foldr or foldMap. According to the exercise, it should have this definition:
mini :: (Foldable t, Ord a) => t a -> Maybe a -- named "mini" to avoid name clash
It sounded pretty straightforward, but I do not know what I can substiture for X below to make it work. Help please?
mini xs = Just (foldr min X xs)
And you get bonus points for showing me how to do it with foldMap too, but that seems harder.