implementation of ruby maybe monad (kinda)