not<T> function

  1. @useResult
bool Function(T) not<T>(
  1. bool p(
    1. T
    )
)

Inverses a predicate boolean evaluation.

Useful as a predicate adjunct for filter-type higher-order functions.

final xs = [1, 2, 3, 4];
final ys = [2, 4];
final odds = xs.where(not(ys.contains)); // [1, 3]

Implementation

@useResult
bool Function(T) not<T>(bool Function(T) p) => (x) => !p(x);