Strathprints Institutional Repository Haskell Programming with Nested Types: a Principled Approach. Higher-order and Symbolic Computation, 22 (2). Pp. 155-189. Haskell Programming with Nested Types: a Principled Approach †
Strathprints Institutional Repository Haskell Programming with Nested Types: a Principled Approach. Higher-order and Symbolic Computation, 22 (2). Pp. 155-189. Haskell Programming with Nested Types: a Principled Approach †
复制标题
Strathprints 机构存储库使用嵌套类型进行 Haskell 编程:高阶和符号计算,第 155-189 页。
DOI:
--
复制
发表时间:
--
期刊:
影响因子:
--
通讯作者:
Patricia Johann
中科院分区:
文献类型:
--
作者:
Neil Ghani;Johann;Patricia;Patricia Johann
Strathprints is designed to allow users to access the research output of the University of Strathclyde. Copyright © and Moral Rights for the papers on this site are retained by the individual authors and/or other copyright owners. You may not engage in further distribution of the material for any profitmaking activities or any commercial gain. You may freely distribute both the url (http://strathprints.strath.ac.uk/) and the content of this paper for research or study, educational, or not-for-profit purposes without prior permission or charge. Abstract. Initial algebra semantics is one of the cornerstones of the theory of modern functional programming languages. For each inductive data type, it provides a Church encoding for that type, a build combinator which constructs data of that type, a fold combinator which encapsulates structured recursion over data of that type, and a fold/build rule which optimises modular programs by eliminating from them data constructed using the build combinator, and immediately consumed using the fold combinator, for that type. It has long been thought that initial algebra semantics is not expressive enough to provide a similar foundation for programming with nested types in Haskell. Specifically, the standard folds derived from initial algebra semantics have been considered too weak to capture commonly occurring patterns of recursion over data of nested types in Haskell, and no build combinators or fold/build rules have until now been defined for nested types. This paper shows that standard folds are, in fact, sufficiently expressive for programming with nested types in Haskell. It also defines build combinators and fold/build fusion rules for nested types. It thus shows how initial algebra semantics provides a principled, expressive, and elegant foundation for programming with nested types in Haskell.