All Projects → swissmanu → pattern-matching-with-typescript

swissmanu / pattern-matching-with-typescript

Licence: MIT License
TypeScript does not have any pattern matching functionality built in. This article shows several ways how you can replicate the core of a simple pattern matcher using a few simple structures and functions within TypeScript. Resulting code will have improved maintainability and better runtime type safety when done right.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pattern-matching-with-typescript

OpenWeatherDemo
Demo app for the article as published on the Delphi Worlds blog
Stars: ✭ 17 (-75.71%)
Mutual labels:  article
How-to-use-C-in-NodeJS-through-CPP
🤓 How to write C code in NodeJS using C++ as a pass through?
Stars: ✭ 50 (-28.57%)
Mutual labels:  article
strings
String helper methods and an inflector
Stars: ✭ 31 (-55.71%)
Mutual labels:  pattern-matching
lispy
Learning with Peter Norvig's lis.py interpreter
Stars: ✭ 133 (+90%)
Mutual labels:  pattern-matching
conditional-expression
JavaScript functional conditional expression
Stars: ✭ 63 (-10%)
Mutual labels:  pattern-matching
mux-stream
(De)multiplex asynchronous streams
Stars: ✭ 34 (-51.43%)
Mutual labels:  pattern-matching
science-fiction-magazines-blog
Blog template (concept) is inspired by stylish science fiction magazines of the 80-90s.
Stars: ✭ 24 (-65.71%)
Mutual labels:  article
nycurl
A web server that fetches data from the New York Times and formats it for display in the terminal.
Stars: ✭ 27 (-61.43%)
Mutual labels:  article
blog
博客,基于issues,技术和思考请参看 https://trello.com/b/fZ2i0xjA
Stars: ✭ 29 (-58.57%)
Mutual labels:  article
ASPCore.BlazorCrud
CRUD Using Blazor And Entity Framework Core
Stars: ✭ 39 (-44.29%)
Mutual labels:  article
babel-plugin-proposal-pattern-matching
the minimal grammar, high performance JavaScript pattern matching implementation
Stars: ✭ 34 (-51.43%)
Mutual labels:  pattern-matching
wechat
WeChat for Jenkins (Jenkins 官方微信公众号)
Stars: ✭ 20 (-71.43%)
Mutual labels:  article
siringa
Minimalist dependency injection library for Python that embraces type annotations syntax
Stars: ✭ 51 (-27.14%)
Mutual labels:  pattern-matching
webflux-streaming-demo
A tryout of reactive application using Spring 5 WebFlux and mongoDB, along with an overview article on reactive programming.
Stars: ✭ 96 (+37.14%)
Mutual labels:  article
how-react-hooks-work
Understand how React-hook really behaves, once and for all!
Stars: ✭ 73 (+4.29%)
Mutual labels:  article
bundler-comparison
Comparison of web resource bundlers. 📦
Stars: ✭ 21 (-70%)
Mutual labels:  article
angular-animations
A sample application exploring the Angular animations module using Angular 8
Stars: ✭ 19 (-72.86%)
Mutual labels:  article
flowpython
tasty feature extensions for python3(NO MAINTENANCE!).
Stars: ✭ 66 (-5.71%)
Mutual labels:  pattern-matching
rmarkdown-templates
A collection of personal templates for RMarkdown
Stars: ✭ 29 (-58.57%)
Mutual labels:  article
steemsnippets
A collection of snippets for steem programming
Stars: ✭ 44 (-37.14%)
Mutual labels:  article

Pattern Matching with TypeScript

TypeScript does not have any pattern matching functionality built in. This article shows several ways how you can replicate the core of a simple pattern matcher using a few simple structures and functions within TypeScript.

Resulting code will have improved maintainability and better runtime type safety when done right.

This is the backing repository for the article "Pattern Matching with TypeScript" published under https://alabor.me/2017/07/05/pattern-matching-with-typescript.html

Examples

The examples/ directory contains example code which goes along with the article read. Every example is fully executable.

You can run the examples by cloning or downloading this repository. Run npm install to install TypeScript and Jest. npm test executes the test suite for the examples.

😎 Pro tip: Run npm test -- --watch if you want to tinker with the code and rerun the test suite automatically.

Article

Github Pages is used to serve the article to you. You find its text and all assets in the gh-pages branch.

Credits

❤️ Thanks to my reviewers for advises and proofreading:

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].