Skip to content

Instantly share code, notes, and snippets.

View Millsky's full-sized avatar
🌮
🌮

Kyle Mills Millsky

🌮
🌮
  • Vibrent Health
  • Fairfax VA
View GitHub Profile
@JackNova
JackNova / JavascriptMonads.js
Created December 19, 2012 18:28
Monads Implementation in javascript, as seen in crockford presentation at yui conf 2012
//BASIC PIECES, 3 functions: unit, bind and the bind argument
//function unit(value)
//function bind(monad, function(value))
//all three functions return a monad
/* The unit function is a constructor (returns a monad object)
* The magic is in the bind function
*
* There are AXIOMS:
* bind(unit(value)), f) === f(value)