This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 { |