Parsing and evidence
How a value earns a stronger type: by being parsed once at a boundary, into a type whose construction is the evidence. Part of Type-driven design.
- Parse, don’t validate: what’s wrong with validating, shotgun parsing, partial functions made total, where to parse, and where it gets harder.
- How strong the evidence is: smart constructors and newtypes, constructive and encapsulated types, hidden constructors, and evidence without runtime cost.
- Types at the boundary: trust boundaries, DTOs and serialization, the database as a boundary, evolving types, and tolerant readers.