3 ms·
Yup, the annotation should be something like: type Ops<T, R, N> = [ (x: T) => N[0], ...<n>((x: N[n]) => N[n + 1]), (x: N.last) => R,
by runarberg 6y ago
Yup, the annotation should be something like:
type Ops<T, R, N> = [
(x: T) => N[0],
...<n>((x: N[n]) => N[n + 1]),
(x: N.last) => R,
];
function pipe<T>(init: T): T;
function pipe<R, T, Ops>(init: T, ...ops: ...Ops<T, R>): R;