Closed arrterian closed 1 year ago
I can see the benefit for inference there, however it breaks partial application (outside of pipelines):
const f = masterMerge({ a: 123 })
const fx = f({ b: 'abc' }) // { a: number } & { b: string }
const g = prMerge({ a: 123 })
const gx = g({ b: 'abc' }) // { a: number }
Then how about this declaration for merge
export declare const merge: <A, B>(x: A) => <C extends B>(y: C) => A & C;
It seems to work for both cases.
Looks good, thank you!
Ah wrong base branch (not your fault). It's cherry-picked into develop
.
Before changes:
After changes: