tjjfvi
• 5.5k
• 3
• 7

# 50-100 rep for answers in TypeScript's type system

There aren't many answers here written in TypeScript's (turing complete) type system; as of posting, there six, two of which are my own. I like seeing such answers, so I'll be awarding a 50 rep bounty to answers that meet all of the following criteria:

• Are posted later than 2021-11-27 (date of bounty posting)
• Consist of a valid TypeScript source file containing a type alias that, given valid input as type parameters, results in a type representing valid output for the challenge
• Input and output types can be any types that reflect the challenge's I/O requirements
• For example, string literals are allowed for a challenge requiring string input, and tuple types are valid where tuples would be
• Type parameters that aren't part of the input but have defaults are valid, even for challenges with no input
• For example, type X<T="a">=T would be valid for a challenge "Output the literal string a with no input"
• Beat all other existing TypeScript type system answers in the challenge, if applicable
• Beat, for the purposes of this bounty, can be done either by the challenge's scoring criterion or by erroring due to the recursion limit on notably fewer inputs
• Produce no compile errors (//@ts-ignore is allowed)
• Make a reasonable attempt to avoid the recursion limit. TypeScript has a very strict recursion limit; 50 for regular types and 1000 for tail-recursive types. Reasonable attempts include:
• Anything that supports most inputs without erroring
• Use of tail recursion to get the 1000 limit
• Anything where I either do not choose to or am not able to send you an altered version that errors on notably fewer inputs
• Use at least one conditional type (e.g. A extends B ? C : D), template literal type (e.g. foo${T}baz), or variadic tuple type (e.g. [T, ...U]), and cannot be beaten by a solution which uses none • Most answers will pass this criterion; this is to exclude things like type A="Hello world!". If your answer does not meet any of these criteria, but you believe it is in the spirit of the bounty nonetheless, any of the criteria can be overridden by my judgement. I'll award 100 rep (total) to answers that match all of the above criteria and at least one of the following criteria: • Are the answerer's first answer in TypeScript's type system • Include a decent explanation (this is, obviously, subjective) • Demonstrate the turing completeness of TypeScript's type system by implementing an interpreter for a turing complete language • Are notable in some other way (again, subjective) If you're not familiar with programming in TypeScript's type system, the TypeScript Handbook, TypeScript Discord Server (I'm @T6 there), and the TypeScript Tips Question are all great resources. To claim a bounty, post a comment on this post with a link to your answer. If I don't respond promptly, feel free to ping me (@T6) in #random of the TypeScript Discord Server, as I'm more active there. ## Awarded Bounties add link to tips tjjfvi • 5.5k • 3 • 7 # 50-100 rep for answers in TypeScript's type system There aren't many answers here written in TypeScript's (turing complete) type system; as of posting, there six, two of which are my own. I like seeing such answers, so I'll be awarding a 50 rep bounty to answers that meet all of the following criteria: • Are posted later than 2021-11-27 (date of bounty posting) • Consist of a valid TypeScript source file containing a type alias that, given valid input as type parameters, results in a type representing valid output for the challenge • Input and output types can be any types that reflect the challenge's I/O requirements • For example, string literals are allowed for a challenge requiring string input, and tuple types are valid where tuples would be • Type parameters that aren't part of the input but have defaults are valid, even for challenges with no input • For example, type X<T="a">=T would be valid for a challenge "Output the literal string a with no input" • Beat all other existing TypeScript type system answers in the challenge, if applicable • Beat, for the purposes of this bounty, can be done either by the challenge's scoring criterion or by erroring due to the recursion limit on notably fewer inputs • Produce no compile errors (//@ts-ignore is allowed) • Make a reasonable attempt to avoid the recursion limit. TypeScript has a very strict recursion limit; 50 for regular types and 1000 for tail-recursive types. Reasonable attempts include: • Anything that supports most inputs without erroring • Use of tail recursion to get the 1000 limit • Anything where I either do not choose to or am not able to send you an altered version that errors on notably fewer inputs • Use at least one conditional type (e.g. A extends B ? C : D), template literal type (e.g. foo${T}baz), or variadic tuple type (e.g. [T, ...U]), and cannot be beaten by a solution which uses none
• Most answers will pass this criterion; this is to exclude things like type A="Hello world!".

If your answer does not meet any of these criteria, but you believe it is in the spirit of the bounty nonetheless, any of the criteria can be overridden by my judgement.

I'll award 100 rep (total) to answers that match all of the above criteria and at least one of the following criteria:

• Include a decent explanation (this is, obviously, subjective)
• Demonstrate the turing completeness of TypeScript's type system by implementing an interpreter for a turing complete language
• Are notable in some other way (again, subjective)

If you're not familiar with programming in TypeScript's type system, the TypeScript Handbook and, TypeScript Discord Server (I'm @T6 there), and the TypeScript Tips Question are bothall great resources.

To claim a bounty, post a comment on this post with a link to your answer. If I don't respond promptly, feel free to ping me (@T6) in #random of the TypeScript Discord Server, as I'm more active there.

tjjfvi
• 5.5k
• 3
• 7

# 50-100 rep for answers in TypeScript's type system

There aren't many answers here written in TypeScript's (turing complete) type system; as of posting, there six, two of which are my own. I like seeing such answers, so I'll be awarding a 50 rep bounty to answers that meet all of the following criteria:

• Are posted later than 2021-11-27 (date of bounty posting)
• Consist of a valid TypeScript source file containing a type alias that, given valid input as type parameters, results in a type representing valid output for the challenge
• Input and output types can be any types that reflect the challenge's I/O requirements
• For example, string literals are allowed for a challenge requiring string input, and tuple types are valid where tuples would be
• Type parameters that aren't part of the input but have defaults are valid, even for challenges with no input
• For example, type X<T="a">=T would be valid for a challenge "Output the literal string a with no input"
• Beat all other existing TypeScript type system answers in the challenge, if applicable
• Beat, for the purposes of this bounty, can be done either by the challenge's scoring criterion or by erroring due to the recursion limit on notably fewer inputs
• Produce no compile errors (//@ts-ignore is allowed)
• Make a reasonable attempt to avoid the recursion limit. TypeScript has a very strict recursion limit; 50 for regular types and 1000 for tail-recursive types. Reasonable attempts include:
• Anything that supports most inputs without erroring
• Use of tail recursion to get the 1000 limit
• Anything where I either do not choose to or am not able to send you an altered version that errors on notably fewer inputs
• Use at least one conditional type (e.g. A extends B ? C : D), template literal type (e.g. foo\${T}baz), or variadic tuple type (e.g. [T, ...U]), and cannot be beaten by a solution which uses none
• Most answers will pass this criterion; this is to exclude things like type A="Hello world!".

If your answer does not meet any of these criteria, but you believe it is in the spirit of the bounty nonetheless, any of the criteria can be overridden by my judgement.

I'll award 100 rep (total) to answers that match all of the above criteria and at least one of the following criteria: