forall is defined in a following way:
final def forall(p: (A) => Boolean): Boolean
Returns true if this Option is empty or the predicate p returns true when applied to this Option's value.
You could rephrase that forall means that none of the elements of the Option violate the given predicate. In case there are no elements, none of them violates it.
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать