Returns a singleton instance of a given value or a function that creates the value.
The type of the value to be returned.
The value or function that creates the value.
The singleton instance of the value.
Returns a singleton instance of a given value or a function that creates the value.