Shouldn't such functionality provided inside match itself, instead of implementing it internally whenever we need it?