Uber and Lyft already do this in San Francisco, and it works very well.
Not sure where you live but I agree with shoyer that Lyft Line and Uber Pool serve this functionality very well in San Francisco, New York, and presumably also the other major metros where they've launched it (Austin, Boston, Chicago, Los Angeles, and Washington, D.C for Lyft Line)
As it turns out, coordinating rides is pretty difficult, even with sophisticated software doing a lot of the work for you. Maybe if either of those companies had huge market shares, then maybe the problem gets easier. I'm not counting on it.