Category: Types

Soundness and Escape Hatches in TypeScript

Understand where TypeScript deliberately trusts the programmer, then contain those assumptions with strict configuration, narrow APIs, validation, and adversarial tests.

2026-07-04 · 13 min read

Refinement and Dependent Types

Use predicates, proof-carrying values, and value-indexed types to express invariants while keeping decidability, runtime boundaries, and ergonomics explicit.

2026-06-22 · 15 min read

Typestate: Encoding Protocols in Types

Typestate turns protocol states and legal transitions into APIs that reject invalid operation sequences before execution.

2026-05-29 · 13 min read

Higher-Kinded Types and Type Constructors

Higher-kinded types let libraries abstract over type constructors while keeping their element relationships and laws visible.

2026-05-17 · 13 min read

Type Classes, Traits, and Protocols

Type classes, traits, and protocols attach operations to types while forcing explicit choices about coherence, dispatch, and evolution.

2026-05-04 · 12 min read

Row Polymorphism and Extensible Records

Row polymorphism types open records and variants by quantifying over the fields or cases a function does not need to know.

2026-04-22 · 13 min read

Branded Types for Safer Domain Modeling

Use branded TypeScript values to protect IDs, validated strings, units, and serialization boundaries without abandoning structural typing.

2026-04-11 · 12 min read

Type Erasure and Reification at Runtime

Understand which type facts survive compilation and how explicit runtime evidence makes untrusted boundaries safe.

2026-04-10 · 13 min read

How Type Inference Actually Works

How TypeScript gathers constraints, solves type variables, widens literals, narrows control flow, and decides when inference must stop.

2025-12-09 · 13 min read