Maybe monad written by JavaScript