Generic functions (multi-argument dispatch) for JavaScript.
npm install panda-genericsPanda Generics brings generics, also known as multi-methods, to JavaScript. Generics are great for functional programming because they offer multi-argument dispatch. That is, you aren't limited to an implicit first argument as you are with object-oriented methods.
npm i panda-generics
``coffee
import Generics from "panda-generics"
import {isObject} from "panda-parchment"
equal = Generics.create
name: "equal"
description: "'Deep' equality operator"
default: (a, b) -> a == b # fallback to shallow equality
equal "this", "this" # => true, shallow equality works here
equal { x: 1, y: 2 }, { x: 1, y: 2 } # => true, deep equality
equal [1..5], [1..5] # true, deep equality
equal { x: 1, y: 2}, [1..5] # false
``