Skip to content

atennapel/ts-typelevel-computation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ts-typelevel-computation

// perform computations on the type level
// includes:
// Boolean: not, and, or, if
// Nat: +, -, *, /, %, sqrt, log2, gcd and comparisons
// Vector: mapping and appending

type Test = Sqrt<_10>; // Test === 3

const vec = cons(1, cons(2, cons(3, nil()))); // length is inferred to be 3
const mapped = vec.map(x => x + 1); // length stays 3

const vecDoubled = vec.append(vec); // length is 6

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published