I’ve written some magic templates that I assume are not easy to read by those who don’t know.
But this is seemingly unmaintainable… terrifying… and kind of neat.
I like to think I can usually look at code in languages I don’t know and still get the gist of what it does but I am drawing a complete blank. Is this even slightly legible to anyone and if yes please explain
After 5 minutes of staring at it: Its typesystem sudoku. Each row and each col in the grid must add up to 15 (T<>), bit each number in the grid must be different (Df<>).
Grid will only be a type alias for the value true (google “Dependent types”) only if all Type Parameters (wich are values) hold up to the Sudoku conditions).
The file would not compile with “true as Grid” when grid type-aliases to false.
Fun to understand.
EDIT: too late
Yeah, and apparently type checking/inference is trivial, says the “CTO” of Xitter. /s
deleted by creator
This doesn’t actually read as serious TypeScript, moreso as someone trying to showcase unhinged code.
I’d be happy to be proven wrong with a link to the source code so that I can look the beast in the eye.
Take a look at some typescript libraries and frameworks and you will see stuff like this. Completely unreadable mess.
Styled Components’ type system is one of the most impressive and most fucked up things I’ve ever had to dive into.