Categorical Thinking in Modern Programming: A TypeScript Based Approach
Keywords:
Category Theory, Cartesian Closed Categories, Lambda Calculus, TypeScript, Type-Level ProgrammingAbstract
This paper explores the fundamental connections between category theory and modern programming languages, focusing on how Cartesian Closed Categories (CCC) provide a rigorous semantic foundation for functional computation. We begin by introducing the core categorical notions-objects, morphisms, products, exponentials - and show how untyped lambda calculus and Church numerals naturally embed into CCCs. Building on this theoretical basis, the paper examines how advanced TypeScript features reflect categorical structures. Structural types behave as objects in a category of types, while function types correspond to exponentials. We analyze three central TypeScript mechanisms - Distributive Types, Indexed Access Types, and Mapped Types-and reinterpret them through categorical semantics: distributive types as functorial behavior over coproduct-like structures, indexed access types as evaluation and projection morphisms, and mapped types as endofunctors acting on the category of TypeScript types. By synthesizing these perspectives, we show that TypeScript’s type system implicitly forms a CCC like environment, where categorical reasoning clarifies the expressive power and limitations of advanced type level programming. The paper provide a categorical perspective for understanding type transformations and concludes by highlighting how categorical abstractions unify these mechanisms.
References
Fiadeiro, J. L. (2005). Categories for software engineering. Springer. https://doi.org/10.1007/b138392
Goldberg, J. (2025). Learning TypeScript. https://www.learningtypescript.com
Gibbok. (2025). The Concise TypeScript book: A concise guide to effective development in TypeScript (Version 6.0). GitHub. https://github.com/gibbok/typescript-book
Milewski, B. (n.d.). Category theory for programmers. https://ai.dmi.unibas.ch/research/reading_group/milewski-2023-01-30.pdf
Smith, P. (2025). Introducing category theory (2nd ed.). Logic Matters. https://www.logicmatters.net/resources/pdfs/SmithCat.pdf
Scott, P. J. (1998). Some aspects of categories in computer science. Department of Mathematics, University of Ottawa.
The Concise TypeScript Book. (2025). Introduction. https://gibbok.github.io/typescript-book
Thompson, S. (1999). Type theory and functional programming. Computing Laboratory, University of Kent.
TypeScript. (2025). The starting point for learning TypeScript. TypeScript Documentation. https://www.typescriptlang.org
TypeScript Team. (2025). TypeScript handbook: Structural typing and interfaces. Microsoft. https://www.typescriptlang.org/docs/
Downloads
Published
Issue
Section
License
Copyright (c) 2026 EIRP Proceedings

This work is licensed under a Creative Commons Attribution 4.0 International License.
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material
- for any purpose, even commercially.
- The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
-
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.