flatmap
import { flatmap } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/promise.ts";Create a new Promise by flatmaping over the result of an existing Promise. This is effectively Promise.then.
@example
import { wrap, flatmap } from "./promise.ts";
import { pipe } from "./fn.ts";
const result = await pipe(
wrap(1),
flatmap(n => wrap(n + 1)),
); // 2
function flatmap<A, I>(faui: (a: A) => Promise<I>): (ua: Promise<A>) => Promise<I>;