why does `all { }` return `true` on an empty colle...
# functional
d
why does
all { }
return
true
on an empty collection, no matter what is in the predicate? Java's
allMatch { }
exhibits the same behaviour... it seems counter-intuitive to me, can someone explain? e.g.
all { false}
and
all { true }
will both yield
true
note: originally I typed
anyMatch
, it was a typo - I meant
allMatch
🤔 2