An implementation of functors, applicatives, and monads in javascript