by nkrisc · 3y ago · 0 comments
Entirely possible that PEBKAC, but I’ve found TypeScript’s documentation to be on the worse end of the programming language documentation quality spectrum.
Random but this is what I’m finding GPT-4 best at: translating random questions into domain terminology + providing examples.
So it works, I guess, but that’s not really how I want to work.
interface add extends F { out: this['args'] extends [infer a, infer b] ?
a extends Zero ? b :
a extends Suc<infer n> ? Suc<apply<add, [n, b]>> :
never : never
}