Views: a way for pattern matching to cohabit with data abstraction

Views: a way for pattern matching to cohabit with data abstraction
复制标题

DOI:
10.1145/41625.41653
复制
发表时间:
1987-10
期刊:
--
影响因子:
--
通讯作者:
P. Wadler
P. Wadler
中科院分区:
其他
文献类型:
--
作者:
P. Wadler

文献摘要

被引文献

相似文献

模式匹配和数据抽象是设计程序的重要概念,但它们不太吻合。模式匹配取决于使公众成为免费的数据类型表示形式,而数据抽象取决于隐藏表示形式。本文提出了观点机制,以调和这场冲突。视图允许将任何类型视为免费的数据类型,从而将模式匹配的清晰度与数据抽象的效率相结合。
Pattern matching and data abstraction are important concepts in designing programs, but they do not fit well together. Pattern matching depends on making public a free data type representation, while data abstraction depends on hiding the representation. This paper proposes the views mechanism as a means of reconciling this conflict. A view allows any type to be viewed as a free data type, thus combining the clarity of pattern matching with the efficiency of data abstraction.