Skip to content

Stronger type systems

Type systems that can state more than ordinary static types: predicates checked by a solver, types that depend on values, and Scala’s richer type features. Part of Type-driven design.

  • Refinement types: what they are, why bother, how SMT-based checking and Liquid inference work, and their limits.
  • Refinement types by language: Python, TypeScript, Haskell, Rust, Ada and Scala, and Scala’s terminology trap.
  • Towards dependent types: the progression from ordinary to dependent types, and the two senses of “dependent”.
  • Scala type system: abstract types and the currency case study, nominal and structural subtyping, union and intersection types, path-dependent types, type tags, multiversal equality, and encoding contracts.

Explore this section

  • Refinement types as base types restricted by predicates: why bother, how SMT-based checking and Liquid inference work, and the limits of the approach.

  • What Python, TypeScript, Haskell, Rust, Ada and Scala offer in place of, or as, refinement types, and Scala's terminology trap: its own \"refinement types\" mean something else.

  • The Scala type features type-driven design relies on: abstract type members, nominal and structural subtyping, union and intersection types, path-dependent types, multiversal equality and contracts.

  • The progression from ordinary types through refinement types to dependent types, the two senses of \"dependent\", and how Haskell, Scala and Pierce's Dependent ML approach it.