Skip to content

Type Abstraction

Types classify values and operations, enabling the compiler or runtime to verify program properties before execution, catching errors early and documenting constraints.

Tension Addressed

Flexibility vs. Safety

Recognizable As

Static typing, dynamic typing, gradual typing, type inference, generics, algebraic data types, contracts

Canonical Sources

Milner, "A Theory of Type Polymorphism in Programming" (1978); Pierce, "Types and Programming Languages" (2002); Cardelli & Wegner (1985)

Transfers To

API Design (interface contracts), Database Design API Designnstraints), Formal Verification, Documentation

Sub-concepts: - Static vs. dynamic checking: When errors are caught (compile time vs runtime) - Algebraic data types: Modeling data as sums (variants) and products (records) - Phantom types: Types for compile-time checking that carry no runtime data