ap<A, B> function
- Identity<
B Function(A)> f
Applies the function wrapped in an Identity to the value inside another Identity.
The ap function takes a wrapped function inside an Identity and applies it to the value of another Identity, giving a new Identity of the result.
Example:
final idValue = Identity(3);
final idFn = Identity<int Function(int)>((x) => x * 2);
final result = ap(idFn)(idValue);
print(result.value); // Outputs: 6
Implementation
Identity<B> Function(Identity<A>) ap<A, B>(Identity<B Function(A)> f) =>
(Identity<A> m) => map(f.value)(m);