Explanation
Why patrun picks the match it picks, how its tree finds it, and what the two ports share.
These pages discuss patrun's design: the reasons behind its rules, and what they cost. They are for reading away from the code.
- Why the most specific pattern winsThe two rules that decide every match, why they give one answer for every query, and what the alphabetical order costs.
- How the tree finds a matchHow a router stores its patterns as a tree of keys and values, why a lookup follows only the branches a query matches, and what the skip paths are for.
- Why every value is a stringWhy patrun stores and matches values as text, takes only maps, and holds a Go pattern's data as a pointer to a string.
- The definitionThe Lean 4 definition of what a router answers, the proofs that the answers are unique, and how it keeps the two ports in step.