Published April 11, 2026 | Version v1

Rank Polymorphism at Work

Description

 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.

Files

paper.pdf

Files (435.9 kB)

Name Size
md5:535f1946095f0e2b76588b9816b22276
435.9 kB Preview Download

Additional details

Dates

Submitted
2026-04-10
JFP