Skip to content

Instantly share code, notes, and snippets.

@johnhunter
johnhunter / monad.js
Created November 7, 2013 17:54
Monad in Javascript
/*
From Doug Crockford's talk 'Monads and Gonads'
*/
/*
Doug calls this a Macroid - a JavaScript version of a macro.
Its purpose is to create the monad unit function for a specific monad type
*/
function MONAD (){