Personal Knowledge Base

Home

❯

main

❯

Parse Dont Validate

Parse Dont Validate

Jun 22, 20251 min read

This idea was popularized in this article, Parse, don’t validate.

The idea is to capture as much information in the type system as possible so that the program doesn’t have to deal with invalid / undefined states everywhere, but at its boundaries. For example, a NonEmpty list enforces this invariant on the list.

Some other articles with the same ideas:

  • Type Safety Back and Forth
  • Safety in an unsafe world
  • Ghosts of Departed Proofs (Functional Pearl) paper source

Graph View

Created with Quartz v4.5.1 © 2025