Is there some function in Racket(Scheme) that can give me the element, which produces the minimum value after applying a given function in a list.
Something like (apply min (map f list)) but returning the element before applying f.
For example:
(define lst '((1 . 3) (3 . 8) (5 . 6))
(define (f pair)
(- (cdr pair) (car pair)))
(minimum f lst)
This should give '(5 . 6).
There should be a one liner for this with higher order functions at least if there is no direct function(as I had to fill in one line to get this behaviour). Any ideas?