tryMap<P> method
Tries to map value to P. If the mapper
throws anything
(not just an Exception), returns Nothing<P>
.
Implementation
@override
Maybe<P> tryMap<P>(P Function(T value) mapper) {
try {
return Just(mapper(value));
} catch (_) {
return Nothing();
}
}