How to keep your neighbours in order
How to keep your neighbours in order
复制标题
如何维持邻居秩序
DOI:
10.1145/2692915.2628163
复制
发表时间:
2014
影响因子:
--
通讯作者:
McBride C
中科院分区:
文献类型:
--
作者:
McBride C
I present a datatype-generic treatment of recursive container types whose elements are guaranteed to be stored in increasing order, with the ordering invariant rolled out systematically. Intervals, lists and binary search trees are instances of the generic treatment. On the journey to this treatment, I report a variety of failed experiments and the transferable learning experiences they triggered. I demonstrate that atotalelement ordering is enough to deliver insertion and flattening algorithms, and show that (with care about the formulation of the types) the implementations remain as usual. Agda'sinstance argumentsandpattern synonymsmaximize the proof search done by the typechecker and minimize the appearance of proofs in program text, often eradicating them entirely. Generalizing to indexed recursive container types, invariants such assizeandbalancecan be expressed in addition toordering. By way of example, I implement insertion and deletion for 2-3 trees, ensuring both order and balance by the discipline of type checking.
登录
查看更多内容
影响因子:
1.1
作者:
Stefan Kahrs
通讯作者:
Stefan Kahrs
DOI:
--
发表时间:
2012
期刊:
Log. Methods Comput. Sci.
影响因子:
--
作者:
R. Atkey;Patricia Johann;Neil Ghani
通讯作者:
Neil Ghani
DOI:
--
发表时间:
2013
期刊:
ACM SIGPLAN Symposium/Workshop on Haskell
影响因子:
--
作者:
S. Lindley;Conor McBride
通讯作者:
Conor McBride
DOI:
--
发表时间:
1987
期刊:
影响因子:
--
作者:
P. Wadler
通讯作者:
P. Wadler
DOI:
--
发表时间:
1969
期刊:
Computer/law journal
影响因子:
--
作者:
R. Burstall
通讯作者:
R. Burstall