IIRC, in the univalent-foundations program (per Voevodsky), category theory is represented as a possible sort of evolution or new wave of type theory. Maybe my memory is off, but anyway, in nlab they say:
Type theory and certain kinds of category theory are closely related. By a syntax-semantics duality one may view type theory as a formal syntactic language or calculus for category theory, and conversely one may think of category theory as providing semantics for type theory. The flavor of category theory used depends on the flavor of type theory; this also extends to homotopy type theory and certain kinds of (∞,1)-category theory.
Also, again IIRC, the choice of name for category theory referred back to Aristotelian/Kantian usage of categories. Suppose that sets are representatives of extension, whereas types are representatives of intension. (Sorry, couldn't find a more specific citation.) In, say, Kantian terms, the categories, being on the side of cognition that is discursive, would therefore be intensional functions. That they would be typomorphic(?) seems to readily follow, at least according to the supposition I just made earlier in this paragraph.
All that being said, for some reason, to me, there is something intuitively different about category theory vs. type theory. AFAIK, type theory was tried out as an alternative foundations of mathematics, but fell to set theory. By contrast, category theory is a to date quite successful picture of an alternative foundations of mathematics.†
Is this because categories are not types? What I was thinking was: a term refers to a set if the reference has elements; a term refers to a type if the reference has tokens (I appreciate that the tokenhood relation does not appear in type theory proper as it does in this other understanding of typology); but if a term's reference has elements and tokens, then that term refers to a category. So what type theory lacks, namely a well-founded theory of extensionality, is made up for by this category-theoretic duality. Then category theory can import the seemingly mathematical qualities of type theory, into the music of its notation, alongside the set-theoretic semiosis, and it would therefore easily seem to supersede unadorned set theory, as a foundation of mathematics.
My only objection at this stage would be to say: in the end, typological functions advert more to the logical sphere††; the distinctly mathematical content of a category is all carried by the elementhood facts that the category figures in. In this sense, the viability of category theory as a sufficiently justified alternative foundation of mathematics, is only an illusion. In all honesty, I actually believe that this objection is true.
†This is perhaps ironic, given that Kantian usage of categories initially motivated this whole new(?) genre of mathematics: according to Kant, after all, we need pure extensional objects (space and time) to adequately ground our mathematics; the bare notion of extensionality wouldn't do (in other words, the intensionality of the term extension is not a sufficient basis for justifiable mathematics).
††The logical elasticity of typology being, then, an analogue or complement of logical pluralism.
How do philosophers of mathematicians understand the differences between set, type, and category theory?