Skip to content

Instantly share code, notes, and snippets.

View jnathn's full-sized avatar

Jonathan Arbaugh jnathn

  • Choice Hotels
  • Phoenix, AZ
View GitHub Profile
@duhduhdan
duhduhdan / Future.js
Last active May 11, 2017 18:08
Experimenting with FP theorems
/**
* Future denotes a value that will occur after a certain amount of time
* Is a Functor:
* - type acting as context for other types
* - can apply normal function inside
* Is a Monad:
* - lifts a normal value to a Monadic one (Future.of)
* - chains 2 consecutive operations (Future.prototype.flatMap)
*/
class Future {