A view on optimal transport from noncommutative geometry