In this article, we study the prehistory of type theory up to 1910 and its development between Russell and Whitehead's Principia Mathematica (, 1910-1912) and Church's simply typed $\lambda$-calculus of 1940. We first argue that the concept of types has always been present in mathematics, though nobody was incorporating them explicitly as such, before the end of the 19th century. Then we proceed by describing how the logical paradoxes entered the formal systems of Frege, Cantor and Peano concentrating on Frege's Grundgesetze der Arithmetik for which Russell applied his famous paradox and this led him to introduce the first theory of types, the Ramified Type Theory (RTT). We present RTT formally using the modern notation for type theory and we discuss how Ramsey, Hilbert and Ackermann removed the orders from RTT leading to the simple theory of types STT. We present STT and Church's own simply typed $\lambda$-calculus ($\lambda \rightarrow C$) and we finish by comparing RTT, STT and $\lambda \rightarrow_C$.
"Types in Logic and Mathematics before 1940." Bull. Symbolic Logic 8 (2) 185 - 245, June 2002. https://doi.org/10.2178/bsl/1182353871