Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Natural Numbers Toy

From zero to infinity and beyond.

Read the code:

console.log(toString(zero));
console.log(toString(one));
console.log(toString(two));
console.log(toString(three));
console.log(toString(four));
console.log(toString(five));

const plusFive = (x: Nat) => plus(five, x);
console.log(toString(plusFive(one)));
console.log(toString(plusFive(two)));
console.log(toString(plusFive(three)));
console.log(toString(plusFive(four)));
console.log(toString(plusFive(five)));

Run the app:

Zero
Succ ( Zero )
Succ ( Succ ( Zero ) )
Succ ( Succ ( Succ ( Zero ) ) )
Succ ( Succ ( Succ ( Succ ( Zero ) ) ) )
Succ ( Succ ( Succ ( Succ ( Succ ( Zero ) ) ) ) )
Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Zero ) ) ) ) ) )
Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Zero ) ) ) ) ) ) )
Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Zero ) ) ) ) ) ) ) )
Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Zero ) ) ) ) ) ) ) ) )
Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Zero ) ) ) ) ) ) ) ) ) )

Compare with the haskell version

About

Natural Numbers Toy

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages