Is there such a thing as maximumWith?
问题 Specifically I'm searching for a function 'maximumWith', maximumWith :: (Foldable f, Ord b) => (a -> b) -> f a -> a Which behaves in the following way: maximumWith length [[1, 2], [0, 1, 3]] == [0, 1, 3] maximumWith null [[(+), (*)], []] == [] maximumWith (const True) x == head x My use case is picking the longest word in a list. For this I'd like something akin to maximumWith length . I'd thought such a thing existed, since sortWith etc. exist. 回答1: Let me collect all the notes in the