flatMap<A, B> function
- Identity<
B> f(- A
Flat maps (or binds) the value inside an Identity using a given function.
The flatMap function applies a function that returns an Identity to the encapsulated value inside an Identity.
Example:
final id = Identity(5);
final result = flatMap<int, int>((x) => Identity(x + 3))(id);
print(result.value); // Outputs: 8
Implementation
Identity<B> Function(Identity<A>) flatMap<A, B>(Identity<B> Function(A) f) =>
(Identity<A> m) => f(m.value);