implemented a monad in ruby