Branded ids, state machines as unions, Result pipelines and a schema validator: the types that make a domain impossible to misuse.