All Projects → ronami → Meta Typing

ronami / Meta Typing

Licence: mit
📚 Functions and algorithms implemented purely with TypeScript's type system

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Meta Typing

Cslearning
开源项目之「计算机编程自学之路」:计算机自学指南+面试大全+资源分享+技术文章
Stars: ✭ 107 (-82.96%)
Mutual labels:  algorithms, learning
Amazon Sagemaker Examples
Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
Stars: ✭ 6,346 (+910.51%)
Mutual labels:  learning, example
Robotics Coursework
🤖 Places where you can learn robotics (and stuff like that) online 🤖
Stars: ✭ 1,810 (+188.22%)
Mutual labels:  algorithms, learning
Godot3 procgen demos
Exploring Procedural Generation algorithms in Godot
Stars: ✭ 85 (-86.46%)
Mutual labels:  algorithms, learning
Cracking The Coding Interview
📚 C++ and Python solutions with automated tests for Cracking the Coding Interview 6th Edition.
Stars: ✭ 396 (-36.94%)
Mutual labels:  algorithms, recursion
Project Euler Solutions
Runnable code for solving Project Euler problems in Java, Python, Mathematica, Haskell.
Stars: ✭ 1,374 (+118.79%)
Mutual labels:  algorithms, recursion
Dsa Geeksclasses
DSA-Self Paced With Doubt Assistance Course Solutions in Python (Python 3)
Stars: ✭ 137 (-78.18%)
Mutual labels:  algorithms, recursion
Algo.js
A Very Basic into Intermediate Algorithm Lesson
Stars: ✭ 11 (-98.25%)
Mutual labels:  algorithms, learning
Learning Rust
Rust 学习之路 > Rust Programming Tutorial, include articles, interview, example, problems.
Stars: ✭ 376 (-40.13%)
Mutual labels:  learning, example
R
All Algorithms implemented in R
Stars: ✭ 294 (-53.18%)
Mutual labels:  algorithms, learning
Coding Ninjas Data Structures And Algorithms In Python
Solved problems and assignments of DSA course taught by Coding Ninjas team
Stars: ✭ 70 (-88.85%)
Mutual labels:  algorithms, recursion
Robotopia
🤖 Introducing kids to coding with tiny virtual robots!
Stars: ✭ 478 (-23.89%)
Mutual labels:  algorithms, learning
Phobos
The standard library of the D programming language
Stars: ✭ 1,038 (+65.29%)
Mutual labels:  algorithms, functional
Letters
Письма к студентам курса
Stars: ✭ 107 (-82.96%)
Mutual labels:  algorithms, learning
Sudoku Generator
A Sudoku puzzle generator written in C++ using modified and efficient backtracking algorithm.
Stars: ✭ 33 (-94.75%)
Mutual labels:  algorithms, recursion
Ultimate Go
This repo contains my notes on working with Go and computer systems.
Stars: ✭ 1,530 (+143.63%)
Mutual labels:  algorithms, example
Typelang
🌳 A tiny language interpreter implemented purely in TypeScript's type-system
Stars: ✭ 149 (-76.27%)
Mutual labels:  recursion, learning
Awesome Ai Books
Some awesome AI related books and pdfs for learning and downloading, also apply some playground models for learning
Stars: ✭ 855 (+36.15%)
Mutual labels:  algorithms, learning
Free Programming Resources
💎 免费的编程资源大全,持续更新!🔥 覆盖各种语言和方向(Java \ Python \ C++ \ JavaScript \ Golang \ 前端 \ 后端等)的学习路线、贴心教程、项目实战、编程书籍、面试合集、实用资源等,对程序员非常有帮助!
Stars: ✭ 225 (-64.17%)
Mutual labels:  algorithms, learning
Algodeck
An Open-Source Collection of 200+ Algorithmic Flash Cards to Help you Preparing your Algorithm & Data Structure Interview 💯
Stars: ✭ 4,441 (+607.17%)
Mutual labels:  algorithms, recursion

📚 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:

  • Math:

    • Basic arithmetic - add one and decrease by one.
    • Add - adds two numbers.
    • Subtract - subtracts two numbers.
    • Multiply - multiplies two numbers.
    • Divide - divides two numbers.
    • Greater than or equal - checks if a value is greater than or equal to another value.
    • Less than or equal - checks if a value is less than or equal to another value.
    • Max - computes the maximum value of an array.
    • Min - computes the minimum value of an array.
    • Sum - computes the sum of the values in array.
    • Remainder - return the remainder (%) when one number is divided by a second number.
  • Lists

    • Head - gets the first element of an array.
    • Tail - gets all but the first element of an array.
    • Reverse - Reverses an array so that the first element becomes the last, the second element becomes the second to last, and so on.
    • Size - gets the size of an array.
    • Concat - creates a new array by concatenating two arrays together.
    • Drop - creates a slice of an array with n elements dropped from the beginning.
    • Take - creates a slice of an array with n elements taken from the beginning.
    • Uniq - creates a duplicate-free version of an array.
    • Includes - checks if a value is an array.
    • IndexOf - gets the index at which the first occurrence of a value is found in an array.
    • Difference - creates an array of values from the first array that are not included in the other given arrays.
    • Intersection - creates an array of unique values that are included in all given arrays.
    • Slice - creates a slice of an array from start up to, but not including, end.
    • Flatten - flattens an array a single level deep.
    • Pull - removes all given values from an array.
    • Chunk - creates an array of elements split into groups the length of size.
    • Zip - creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.
    • Range - creates an array of numbers progressing from start up to, but not including, end.
  • Sorting

    • Quick-sort - an efficient sorting algorithm.
    • Merge-sort - another efficient sorting algorithm.
    • Insertion-sort - a simple sorting algorithm that builds the final sorted array (or list) one item at a time.
  • Utility

    • IsEqual - compares between two values to determine if they are equivalent.
  • Puzzles

    • N-Queens - the problem of placing N chess queens on an N×N chessboard so that no two queens threaten each other.
    • Maze-solving - find the shortest path to solve a maze with obstacles.
    • Binary trees - a tree data structure in which each node has at most two children.
    • Square Matrix Rotation - you are given an N×N 2D matrix (representing an image). Rotate the matrix by 90 degrees (clockwise and counter-clockwise).
    • Towers of Hanoi - a mathematical game or puzzle that consists of three rods and a number of disks of different sizes.

Additional links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].