Deriving monadic quicksort (Declarative Pearl)

Shin-Cheng Mu,Tsung-Ju Chiang
DOI: https://doi.org/10.48550/arXiv.2101.11421
2021-01-27
Programming Languages
Abstract:To demonstrate derivation of monadic programs, we present a specification of sorting using the non-determinism monad, and derive pure quicksort on lists and state-monadic quicksort on arrays. In the derivation one may switch between point-free and pointwise styles, and deploy techniques familiar to functional programmers such as pattern matching and induction on structures or on sizes. Derivation of stateful programs resembles reasoning backwards from the postcondition.
What problem does this paper attempt to address?