To run script
node index.js
const daggy = require('daggy'); | |
const { merge } = require('ramda'); | |
function fantasyLandDaggy() { | |
const Coord = daggy.tagged('Coord', ['x', 'y', 'z']); | |
const Line = daggy.tagged('Coord', ['from', 'to']) | |
Coord.prototype.equals = function coordEquals(that) { | |
return this.x == that.x |
/** | |
* Filters an array of objects using custom predicates. | |
* | |
* @param {Array} array: the array to filter | |
* @param {Object} filters: an object with the filter criteria | |
* @return {Array} | |
*/ | |
function filterArray(array, filters) { | |
const filterKeys = Object.keys(filters); | |
return array.filter(item => { |
CATEGORY THEORY FOR PROGRAMMERS | |
Category Theory 1.1: Motivation and Philosophy | |
https://www.youtube.com/watch?v=I8LbkfSSR58&index=1&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_ | |
Composability, Abstraction, Reusability | |
Category Theory is a higher-level language. | |
Not a practical, executable language. |