首页 | 本学科首页   官方微博 | 高级检索  
     


Generalised folds for nested datatypes
Authors:Richard Bird  Ross Paterson
Affiliation:(1) Programming Research Group, Oxford University, Oxford, UK, UK;(2) Department of Computer Science, City University, London, UK, UK
Abstract:Nested datatypes generalise regular datatypes in much the same way that context-free languages generalise regular ones. Although the categorical semantics of nested types turns out to be similar to the regular case, the fold functions are more limited because they can only describe natural transformations. Practical considerations therefore dictate the introduction of a generalised fold function in which this limitation can be overcome. In the paper we show how to construct generalised folds systematically for each nested datatype, and show that they possess a uniqueness property analogous to that of ordinary folds. As a consequence, generalised folds satisfy fusion properties similar to those developed for regular datatypes. Such properties form the core of an effective calculational theory of inductive datatypes. Received September 1998 / Accepted in revised form July 1999
Keywords:: Functional programming  Program construction
本文献已被 SpringerLink 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号