extract<A> function
- Identity<
A> identity
Extracts the value contained within the identity
.
This is a utility function to retrieve the raw value wrapped inside the Identity. You can think of it as a way to perform a "safe unwrap" of the Identity's contents.
Example:
final wrappedInt = Identity(5);
final intValue = extract(wrappedInt); // Returns 5
final wrappedString = Identity("Hello");
final stringValue = extract(wrappedString); // Returns "Hello"
Implementation
A extract<A>(Identity<A> identity) => identity.value;