#Programming in a #dependent #type system does not imply a blind obedience to the type system by the #programmer: not all types need be adorned with fully-dependent regalia. That is, the programmer selects the desired level of type specificity. For example, we may type the all-too-familiar \(\texttt{qsort}\) with progressively finer specificity, as follows:
• Simple, parameterised typed:
\[
𝑞𝑠𝑜𝑟𝑡\ :\ [ℤ]→[ℤ]
\]
• Dependent, parameterised, indexed typed:
\[
qsort\ :\ (n : ℕ) ⇒ [ℤ\ n] → [ℤ\ n]
\]
• Fully-dependent, parameterised, indexed, predicated \(\Sigma\) type:
\[
𝑞𝑠𝑜𝑟𝑡\ :\ (𝑛:ℕ)⇒[ℤ\ 𝑛]→(𝑥𝑥:[ℤ\ 𝑛], 𝑆𝑜𝑟𝑡𝑒𝑑\ 𝑥𝑥)
\]
The closer we approach full dependence, the greater our burden of proof and the messier our #code. And the farther we retreat from full dependence, the less precise our type specifications and the weaker their #correctness guarantees.
Such is the thug-life of a programmer....🤷♂️