To run script
node index.js
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH | |
| # Path to your oh-my-zsh installation. | |
| export ZSH="$HOME/.oh-my-zsh" | |
| # Set name of the theme to load --- if set to "random", it will | |
| # load a random theme each time oh-my-zsh is loaded, in which case, | |
| # to know which specific one was loaded, run: echo $RANDOM_THEME | |
| # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes |
| 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. |