The only difference between this function and one that simply unwraps an option safely (ie. with a ~default argument) is that here the default argument isn’t evaluated right away but is instead a function to be called if needed. This is why Containers calls this function get_lazy (corresponding to its get_or, which preceded the stdlib’s value but has the same functionality). A similar name for this function that matches the stdlib’s terminology would be value_lazy.
2 Likes