Presentation (JA): TSKaigi 2025
Deck
https://decks.yasaichi.com/20250524/pragmatic-functional-programming-in-typescript
Abstract
Functional programming concepts such as pure functions, immutability, and monads are increasingly familiar to TypeScript developers, yet many struggle to apply them effectively in production systems. The gap is not in theory, but in understanding how these ideas translate into maintainable, real-world code.
This session reframes the five principles proposed by Dmitrii Kovanikov—Parse, Don’t Validate; Make Illegal States Unrepresentable; Errors as Values; Functional Core, Imperative Shell; and Smart Constructors—through the lens of Design by Contract, focusing on preconditions, postconditions, and invariants as a practical mental model. Using TypeScript examples, I will demonstrate how these principles improve correctness, extensibility, and resilience in evolving systems.
I will also present a case study from EARTHBRAIN’s API gateway development effort, illustrating how these principles integrate with tactical DDD and layered architecture. Attendees will gain actionable patterns that apply not only to backend services, but also to complex, stateful frontend applications.
By the end of the session, participants will have a clear methodology for applying functional programming pragmatically—bridging conceptual understanding and production-grade implementation.



