cujojs/most — pull request #11 by briancavalier (2014-02-06 02:51:29+00:00)
Title: Add lazy minimal promise. Promises/A+ interoperable, but not fully compliant

Mostly for discussion. This is a lazy monadic promise with map, flatMap, and ap. It also has a then() that recursively unwraps promises and thenables, so is Promises/A+ interoperable.

It's lazy in that the promise doesn't run its resolve until done() is called the first time. So, promises must be consumed via then, before any work is done. That also forces people to handle errors since done will throw loudly on any unhandled rejection (thus crashing node).