This pearl demonstrates how rank‑polymorphism enables programmers to abstract performance‑tuning aspects into the ranks and shapes of function arguments. Using prefix sum as an example, we show how a single, generic rank‑polymorphic specification can represent an entire class of traditionally separate algorithmic specifications that differ in performance characteristics but not in the overall outcome. The genuine elegance of this approach lies in the observation that, once encoded within a dependently‑typed language, we can prove that certain classes of argument reshaping do not affect the overall computational outcome. Consequently, this establishes the equivalence of all corresponding algorithmic specifications, which in classic (typically imperative) settings would be extremely tedious, if feasible at all.
Building similarity graph...
Analyzing shared references across papers
Loading...
Artjoms Šinkarovs
Heriot-Watt University
Sven‐Bodo Scholz
Radboud University Nijmegen
Building similarity graph...
Analyzing shared references across papers
Loading...
Šinkarovs et al. (Fri,) studied this question.
synapsesocial.com/papers/69db38534fe01fead37c6866 — DOI: https://doi.org/10.5281/zenodo.19503140