contramap<A> method
Apply map
to the value of the parameter P
and return a new bool Function(A)
.
Similar to map
for functions that return bool
.
bool even(int n) => n % 2 == 0;
final evenLength = even.contramap<String>((a) => a.length);
Implementation
bool Function(A) contramap<A>(P Function(A a) map) => (a) => this(map(a));