tap method
Invokes action with the data on success, passing through the result
unchanged. Useful for side effects like logging without transforming.
Implementation
Result<T> tap(void Function(T data) action) {
if (this case Success<T>(:final data)) action(data);
return this;
}