Sample implementation of a couple of monads in Ruby