A collection of cursed types, or a repository in which I abuse the fact that TypeScript's type system is Turing complete to write programs that "run" at compile time.
type-challenges/
- My solutions to problems from https://github.com/type-challenges/type-challenges.
random/
- Basically everything else, e.g. a Conway's Game of Life simulator, a Sudoku solver, and a Brainfuck interpreter.
You might be able to temporarily bypass the "Type instantiation is excessively deep and possibly infinite" error by editing the TypeScript server. Does not work in the playground.
- Open the "Output" tab (View > Output)
- Select "TypeScript" from the dropdown
- Look for a log line that starts with "Using tsserver from: <some_file_path>/tsserver.js"
- Open
tsserver.js
- Ctrl-F "Type_instantiation_is_excessively_deep_and_possibly_infinite". There should be 4 occurences
- For the 3rd and 4th occurences, change the number in the condition above to some much larger number (or just comment the blocks out altogether if you're brave)
- Restart the TypeScript server