|
|
|
|
|
by porridgeraisin
1000 days ago
|
|
export const pipe = <A, B>(f: Fun<A, B>) => {
return {
to: <C>(g: Fun<B, C>) => pipe((arg: A) => g(f(arg))),
build: () => f,
};
};
Much simpler alternative. const process = pipe(readLines).to(x => cut(x, 2)).to(....).build()
const result = await process(fd)
P.S the Fun type is just (...args: A) => B |
|