export const sequence = (fn: ($: T) => Promise) => async (L: T[]) => { for (const o of L) await fn(o); }; export const parallel = (fn: ($: T) => Promise) => async (L: T[]) => { await Promise.all(L.map(fn)); }; export const notUndefined: ($: T | undefined) => T = $ => { if ($ === undefined) throw Error('the value is undefined!'); else return $; };