when abstract method
Calls success
if this is a Success
, or failure
if this is a Failure
.
Success('s').when(success: print); // 's'
Failure('f').when(success: print); // nothing
Implementation
void when({Consume<S> success = _nothing, Consume<F> failure = _nothing});