Coder Social home page Coder Social logo

nowayhecodes / semiconductor Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 273 KB

Multiple dispatch pattern library written with TypeScript

License: MIT License

Shell 1.64% JavaScript 8.63% TypeScript 89.74%
multiple-dispatch multimethods typescript typescript-library ts npm-package fp functional immutable

semiconductor's Introduction

codecov languages top-language code-size npm-downloads license release types

Semiconductor

Multiple dispatch pattern library written with TypeScript.

This library provides a tiny set of higher-order functions to create powerful, immutable multimethods - in a functional way.

To summarize, multiple dispatch (or multimethods) is a way to add superpowers to our functions/methods. They can do all that ordinary functions can, and additionally:

  • can choose proper implementation based on the provided arguments, without explicit conditional logic
  • can be easily extended, without the need to modify the original code
  • allow you to write clean, concise and decoupled code

What?

Multiple dispatch (or multimethods) is a pattern in which a function or method can be dynamically dispatched based on the run-time (dynamic) type or, in the more general case, some other attribute of more than one of its arguments.

Multiple dispatch is a generalization of single dispatch polymorphism, where a method call is dynamically dispatched based on the derived type of object on which the method has been called.

Multiple dispatch routes the dynamic dispatch to the implementing method using the combined characteristics of one or more arguments.

semiconductor's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.