TaskClass.prototype.map<U>(fn: (value: T) => U | PromiseLike<U>): TaskClass<U, E>
Transforms the success value — .then(fn) that stays a Task: lazy, retryable, E kept.
fn may return a value or a promise of one (they flatten), so this is andThen too.
const loadUser = (id: number) => Task(() => ({ name: 'u' + id })); loadUser(1).map((u) => u.name).map((n) => n.toUpperCase()); // still lazy, still a Task