David Ricardo, in the third edition of his Principles (this is from chapter 31, "On Machinery," 1821), reconsiders how the invention of new machinery affects labor:
Ever since I first turned my attention to questions of political economy, I have been of opinion, that such an application of machinery to any branch of production, as should have the effect of saving labour, was a general good, accompanied only with that portion of inconvenience which in most cases attends the removal of capital and labour from one employment to another. It appeared to me, that provided the landlords had the same money rents, they would be benefited by the reduction in the prices of some of the commodities on which those rents were expended, and which reduction of price could not fail to be the consequence of the employment of machinery. The capitalist, I thought, was eventually benefited precisely in the same manner. He, indeed, who made the discovery of the machine, or who first usefully applied it, would enjoy an additional advantage, by making great profits for a time; but, in proportion as the machine came into general use, the price of the commodity produced, would, from the effects of competition, sink to its cost of production, when the capitalist would get the same money profits as before, and he would only participate in the general advantage, as a consumer, by being enabled, with the same money revenue, to command an additional quantity of comforts and enjoyments. The class of labourers also, I thought, was equally benefited by the use of machinery, as they would have the means of buying more commodities with the same money wages, and I thought that no reduction of wages would take place, because the capitalist would have the power of demanding and employing the same quantity of labour as before, although he might be under the necessity of employing it in the production of a new, or at any rate of a different commodity. ...
These were my opinions, and they continue unaltered, as far as regards the landlord and the capitalist; but I am convinced, that the substitution of machinery for human labour, is often very injurious to the interests of the class of labourers.
My mistake arose from the supposition, that whenever the net income of a society increased, its gross income would also increase; I now, however, see reason to be satisfied that the one fund, from which landlords and capitalists derive their revenue, may increase, while the other, that upon which the labouring class mainly depend, may diminish, and therefore it follows, if I am right, that the same cause which may increase the net revenue of the country, may at the same time render the population redundant, and deteriorate the condition of the labourer. ...
That the opinion entertained by the labouring class, that the employment of machinery is frequently detrimental to their interests, is not founded on prejudice and error, but is conformable to the correct principles of political economy.
However, he goes on to say that this shouldn't be viewed as a call to discourage machinery:
The statements which I have made will not, I hope, lead to the inference that machinery should not be encouraged. ... The employment of machinery could never be safely discouraged in a State, for if a capital is not allowed to get the greatest net revenue that the use of machinery will afford here, it will be carried abroad, and this must be a much more serious discouragement to the demand for labour, than the most extensive employment of machinery; for, while a capital is employed in this country, it must create a demand for some labour; machinery cannot be worked without the assistance of men, it cannot be made but with the contribution of their labour. By investing part of a capital in improved machinery, there will be a diminution in the progressive demand for labour; by exporting it to another country, the demand will be wholly annihilated.
So, in Ricardo's view, it is a choice between the potential for detrimental effects on labor from the use of new machinery versus even worse effects if the machinery is not used at all. His argument can certainly be questioned, at least in some places, but this is not the positive "lift all boats" theory of growth that is often attributed to Ricardo.