I was hoping to gather opinions on changing the behavior of floats.Min/floats.Max. The proposed new behavior is to have
func floats.MinIdx(s []float64) int
func floats.Min(s []float64) float64
func floats.MaxIdx(s []float64) int
func floats.Max(s []float64) float64
The current signature was chosen to keep the number of functions small, and both of these operations are useful. However, I have found the current behavior annoying. Frequently these operations are building blocks to larger expressions, and it's nice to be able to express them as such. This proposal does increase the API surface, but it seems to me that's it's worth it to make floats more smooth to use. This is a breaking change, but
a) now's a good time to do it with the current breaking changes
b) most code uses one or the other, fix is an easy deletion
c) At least as per godoc, most of the code that imports floats is either in the gonum suite, or is in packages owned by me, so it's a good time to change before there is too much code that depends on the behavior
Comments?