It works, but it is not very valuable, right? I mean, main objection was that
findmax(f, itr) should work with any iterator, even those which has no index.
With proposed change key feature of the current version of
findmax(f, itr) is nullified (triplet will work only for arrays) and the only addition is
v[ix] which is not that important. I mean, it literally just remove one line from
val, ix = findmax(f, A) domain = A[ix]
Also, three values returned as a tuple is very confusing I already do not remember which one is index, which is