from https://www.archives.gov/education/lessons/cotton-gin-patent:
"... In 1798 he figured out how to manufacture muskets by machine so that the parts were interchangeable. It was as a manufacturer of muskets that Whitney finally became rich. If his genius led King Cotton to triumph in the South, it also created the technology with which the North won the Civil War."