Understanding idiomatic traversals backwards and forwards
Understanding idiomatic traversals backwards and forwards
复制标题
理解惯用的前后遍历
DOI:
10.1145/2503778.2503781
复制
发表时间:
2013
期刊:
影响因子:
--
通讯作者:
Bird R
中科院分区:
文献类型:
--
作者:
Bird R
We present new ways of reasoning about a particular class of effectful Haskell programs, namely those expressed as idiomatic traversals. Starting out with a specific problem about labelling and unlabelling binary trees, we extract a general inversion law, applicable to any monad, relating a traversal over the elements of an arbitrary traversable type to a traversal that goes in the opposite direction. This law can be invoked to show that, in a suitable sense, unlabelling is the inverse of labelling. The inversion law, as well as a number of other properties of idiomatic traversals, is a corollary of a more general theorem characterising traversable functors as finitary containers: an arbitrary traversable object can be decomposed uniquely into shape and contents, and traversal be understood in terms of those. Proof of the theorem involves the properties of traversal in a special idiom related to the free applicative functor.
登录
查看更多内容
影响因子:
0.8
作者:
GIRARD, JY
通讯作者:
GIRARD, JY
影响因子:
4.6
作者:
E. Moggi;Gianna Bellè;C. Jay
通讯作者:
C. Jay
影响因子:
4.6
作者:
Mauro Jaskelioff;Ondrej Rypacek
通讯作者:
Ondrej Rypacek
影响因子:
4.6
作者:
F. Pearl;Janis Voigtl
通讯作者:
Janis Voigtl
影响因子:
4.6
作者:
J. Voigtländer
通讯作者:
J. Voigtländer