Meetup talk in Brno for Next.js & Strapi developers - a deep-dive into TypeScript's type system as a programming language of its own. Built around the story of a Haskell-inspired calculator with zero runtime code, teaching recursion, conditional types, and infer as practical tools for reading real library types.
Released: Thu Apr 23 2026
The origin story
An engineer on my team who was heavily invested in Haskell once brought something unusual to a 1-on-1: a functional calculator built entirely within TypeScript's type system - zero runtime code allowed. While practically "useless" for business logic, it turned out to be the ultimate educational tool for understanding how libraries like Zod, Prisma, and tRPC work under the hood.
What the talk covered
- Counting with Tuples - TypeScript doesn't do math natively; using
lengthon Tuple types to represent numbers. - Recursive Conditional Types - how to loop without
forloops, using recursive types for compile-time computation. - Pattern Matching with
infer- destructuring types to extract values; the key to reading complex library definitions. - Practical payoff - de-obfuscating scary type definitions from popular libraries and debugging "Type instantiation is excessively deep" errors.
Who it was for
Developers who use TypeScript day-to-day but find themselves copy-pasting generics from Stack Overflow without understanding them. After this talk, the mental model for recursive types and inference is concrete - not just theoretical.
