not<A> function
- Predicate<
A> predicate
Creates a new predicate that is the logical negation of a given predicate.
Example usage:
```dart
Predicate<int> isEven = (int n) => n % 2 == 0;
Predicate<int> isOdd = not(isEven);
print(isOdd(2)); // Prints: false
print(isOdd(1)); // Prints: true
Implementation
Predicate<A> not<A>(Predicate<A> predicate) {
return (A value) {
return !predicate(value);
};
}