oh, sorry Mike, I see what you mean, reduce would ...
# stdlib
d
oh, sorry Mike, I see what you mean, reduce would work on a NonEmptyIterable, I thought you meant as a return from
sequence.reduce
n
yep nobody seemed to care about my point 😂
d
I do, but I'm a little biased, if it was me there would be no runtime exceptions in the std lib
n
thanks for the support 🙂 i was actually searching for insights from the developers they probably could have told why they designed it like that and perhaps think about making more robust i think it’s the first time i discover something done better in the java api
d
I think it must be an omission/bug. the min/max/maxBy/etc methods on a sequence of comparable T, return
T?
It seems additionally counter intuitive because, the only way to know it is not-empty is to start to consume/evaluate it before reducing. Which might not be desirable as sequences are non strict.