I\'m looking for an idiomatic (pipe-based) way to find the minimum/maximum of a given function in an interval. Let\'s say I have an arbitrary function, such as