Home

Awesome

📚 Meta-Typing

Functions and algorithms implemented purely with TypeScript's type system

Introduction

TypeScript's type system lets us catch bugs and errors in our code as we write it, instead of later on when the code runs. But... that's the obvious way to use the type system... 😜

This project attempts to push TypeScript's type system to its limits by actually implementing various functions and algorithms, purely on top of the type system.

Every implementation includes comments describing in detail what's going on. Some functions and algorithms use creative (and sometimes not officially supported) solutions to overcome some limitations of the type system.

☝ Please note that this project is meant to be used for fun and learning purposes and not for practical use.

showcase

Try running the code

Start by installing dependencies:

$ yarn

Open a file of any function or algorithm and hover over the types to see the results of "running" that function with some input (try hovering the resulting type).

You can also run tests (written with tsd) with:

$ yarn test

Functions and algorithms:

Additional links