Results 1 
7 of
7
Generalized Iteration and Coiteration for HigherOrder Nested Datatypes
 PROC. OF FOSSACS 2003
, 2003
"... We solve the problem of extending Bird and Paterson's generalized folds for nested datatypes and its dual to inductive and coinductive constructors of arbitrarily high ranks by appropriately generalizing Mendlerstyle (co)iteration. Characteristically to Mendlerstyle schemes of disciplined (co ..."
Abstract

Cited by 8 (5 self)
 Add to MetaCart
We solve the problem of extending Bird and Paterson's generalized folds for nested datatypes and its dual to inductive and coinductive constructors of arbitrarily high ranks by appropriately generalizing Mendlerstyle (co)iteration. Characteristically to Mendlerstyle schemes of disciplined (co)recursion, the schemes we propose do not rest on notions like positivity or monotonicity of a constructor and facilitate programming in a natural and elegant style close to programming with the customary letrec construct, where the typings of the schemes, however, guarantee termination. For rank 2, a smoothened version of Bird and Paterson's generalized folds and its dual are achieved; for rank 1, the schemes instantiate to Mendler's original (re)formulation of iteration and coiteration. Several examples demonstrate the power of the approach. Strong normalization of our proposed extension of system F of higherorder parametric polymorphism is proven by a reductionpreserving embedding into pure F .
(Co)iteration for higherorder nested datatypes
 POSTCONF. PROC. OF IST WG TYPES 2ND ANN. MEETING, TYPES'02, LECT. NOTES IN COMPUT. SCI
, 2003
"... The problem of defining iteration for higherorder nested datatypes of arbitrary (finite) rank is solved within the framework of System F ω of higherorder parametric polymorphism. The proposed solution heavily relies on a general notion of monotonicity as opposed to a syntactic criterion on the sh ..."
Abstract

Cited by 8 (5 self)
 Add to MetaCart
The problem of defining iteration for higherorder nested datatypes of arbitrary (finite) rank is solved within the framework of System F ω of higherorder parametric polymorphism. The proposed solution heavily relies on a general notion of monotonicity as opposed to a syntactic criterion on the shape of the type constructors such as positivity or even being polynomial. Its use is demonstrated for some rank2 heterogeneous/nested datatypes such as powerlists and de Bruijn terms with explicit substitutions. An important feature is the availability of an iterative definition of the mapping operation (the functoriality) for those rank1 type transformers (i. e., functions from types to types) arising as least fixedpoints of monotone rank2 type transformers. Strong normalization is shown by an embedding into F ω. The results dualize to greatest fixedpoints, hence to coinductive constructors with coiteration.
Parametric DatatypeGenericity
"... Datatypegeneric programs are programs that are parametrized by a datatype or type functor: whereas polymorphic programs abstract from the ‘integers ’ in ‘lists of integers’, datatypegeneric programs abstract from the ‘lists of’. There are two main styles of datatypegeneric programming: the Algebr ..."
Abstract

Cited by 5 (3 self)
 Add to MetaCart
Datatypegeneric programs are programs that are parametrized by a datatype or type functor: whereas polymorphic programs abstract from the ‘integers ’ in ‘lists of integers’, datatypegeneric programs abstract from the ‘lists of’. There are two main styles of datatypegeneric programming: the Algebra of Programming approach, characterized by structured recursion operators arising from initial algebras and final coalgebras, and the Generic Haskell approach, characterized by case analysis over the structure of a datatype. We show that the former enjoys a kind of higherorder naturality, relating the behaviours of generic functions at different types; in contrast, the latter is ad hoc, with no coherence required or provided between the various clauses of a definition. Moreover, the naturality properties arise ‘for free’, simply from the parametrized types of the generic functions: we present a higherorder parametricity theorem for datatypegeneric operators. Categories and Subject Descriptors D.3.3 [Programming languages]: Language constructs and features—Polymorphism, patterns, control structures, recursion; F.3.3 [Logics and meanings of programs]: Studies of program constructs—Program and recursion schemes, type structure; F.3.2 [Logics and meanings of programs]: Semantics of programming languages—Algebraic approaches to semantics; D.3.2 [Programming languages]: Language classifications—Functional languages.
Enumerating the Rationals
"... We present a series of lazy functional programs for enumerating the rational numbers without duplication, drawing on some elegant results of Neil Calkin, Herbert Wilf and Moshe Newman. ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
We present a series of lazy functional programs for enumerating the rational numbers without duplication, drawing on some elegant results of Neil Calkin, Herbert Wilf and Moshe Newman.
Generic Operations on Nested Datatypes
, 2001
"... Nested datatypes are a generalisation of the class of regular datatypes, which includes familiar datatypes like trees and lists. They typically represent constraints on the values of regular datatypes and are therefore used to minimise the scope for programmer error. ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
Nested datatypes are a generalisation of the class of regular datatypes, which includes familiar datatypes like trees and lists. They typically represent constraints on the values of regular datatypes and are therefore used to minimise the scope for programmer error.
Fixed Points of Type Operators and Primitive Recursion
, 2004
"... Abstract. For nested or heterogeneous datatypes, terminating recursion schemes considered so far have been instances of iteration, excluding efficient definitions of fixedpoint unfolding. Two solutions of this problem are proposed: The first one is a system with equirecursive nonstrictly positive ..."
Abstract
 Add to MetaCart
Abstract. For nested or heterogeneous datatypes, terminating recursion schemes considered so far have been instances of iteration, excluding efficient definitions of fixedpoint unfolding. Two solutions of this problem are proposed: The first one is a system with equirecursive nonstrictly positive type operators of arbitrary finite kinds, where fixedpoint unfolding is computationally invisible due to its treatment on the level of type equality. Positivity is ensured by a polarized kinding system, and strong normalization is proven by a model construction based on saturated sets. The second solution is a formulation of primitive recursion for arbitrary type constructors of any rank. Although without positivity restriction, the second system embeds—even operationally—into the first one. 1
Parametric DatatypeGenericity
, 2007
"... Datatypegeneric programs are programs that are parametrized by a datatype or type functor. There are two main styles of datatypegeneric programming: the Algebra of Programming approach, characterized by structured recursion operators parametrized by a shape functor, and the Generic Haskell approac ..."
Abstract
 Add to MetaCart
Datatypegeneric programs are programs that are parametrized by a datatype or type functor. There are two main styles of datatypegeneric programming: the Algebra of Programming approach, characterized by structured recursion operators parametrized by a shape functor, and the Generic Haskell approach, characterized by case analysis over the structure of a datatype. We show that the former enjoys a kind of parametricity, relating the behaviours of generic functions at different types; in contrast, the latter is more ad hoc, with no coherence required or provided between the various clauses of a definition. 1