It would be nice to have a minimumOn function of the form:
minimumOn:: (Ordb, Generic.Vectorva) => (a->b) ->va->a
A possible implementation could just adapt the existing one for minimumBy:
minimumOn:: (Ordb, Vectorva) => (a->b) ->va->a
{-# INLINE minimumOn #-}
minimumOn f =Bundle.foldl1' minBy . stream
where
{-# INLINE minBy #-}
minBy x y =casecompare (f x) (f y) ofGT-> y
_ -> x
It would be nice to have a
minimumOnfunction of the form:A possible implementation could just adapt the existing one for
minimumBy: