Apply a function to an Invalid value, returning a new Invalid value. Or, if the original valid was Valid, return it.