当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Deriving monadic quicksort (Declarative Pearl)
arXiv - CS - Programming Languages Pub Date : 2021-01-27 , DOI: arxiv-2101.11421
Shin-Cheng Mu, Tsung-Ju Chiang

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.

中文翻译:

派生单子快速排序(声明性珍珠)

为了演示单子程序的派生,我们提出了使用非确定性单子的排序规范,并派生了列表上的纯快速排序和数组上的状态单子快速排序。在推导过程中,可以在无点样式和逐点样式之间切换,并部署功能程序员熟悉的技术,例如在结构或大小上进行模式匹配和归纳。有状态程序的派生类似于从后置条件向后推理。
更新日期:2021-01-28
down
wechat
bug