A first stab at defining monads based on C++ vector and shared_ptr.