Private
constructorPrivate
valueThe value or absence of a value.
Flattens a Maybe instance by removing one level of nesting, if applicable. If the internal value is a Maybe instance, returns that instance directly; otherwise, returns the original Maybe instance.
A new Maybe instance with one level of nesting removed.
Maps the wrapped value of Maybe using a provided function and then flattens the result.
The mapping function to apply to the internal value.
A new Maybe instance containing the result of applying the function.
Applies a function to the value inside the Maybe instance if it is present, returning a new Maybe instance containing the result of the function. If the Maybe instance is empty, it returns itself.
A new Maybe instance containing the result of the function.
Applies a function to the value inside the Maybe instance if it is empty, returning a new Maybe instance containing the result of the function. If the Maybe instance is not empty, it returns itself.
A new Maybe instance containing the result of the function.
Static
createGenerated using TypeDoc
Represents a container that may or may not contain a value of type T. Maybe
Example: Using maybe to check a environment variable