def wrapM(monad):
    """
    Takes a monad and wraps it so that any attribute that is not
    in the monad is automaticall forwarded to the monad value.

    Complexity: O(1)
    params:
        monad: the monad to wrap
    returns: the proxy object
    """
    class Proxy():
        """The monad proxy object"""
        def __init__(self, monad):
            self.monad = monad

        def __getattr__(self, prop):
            if hasattr(self.monad, prop):
                return getattr(self.monad, prop)
            elif hasattr(self.monad.value, prop):
                return getattr(self.monad.value, prop)
            raise AttributeError(prop)

    return Proxy(monad)