exists method

bool exists(
  1. bool predicate(
    1. A a
    )
)

Return true if this option is nonempty and the predicate returns true Otherwise return false

Implementation

bool exists(bool Function(A a) predicate) =>
    (this.isDefined && predicate((this as Some).value)) ? true : false;