Results 1 -
8 of
8
Generalized Iteration and Coiteration for Higher-Order 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 Mendler-style (co)iteration. Characteristically to Mendler-style schemes of disciplined (co)recu ..."
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 Mendler-style (co)iteration. Characteristically to Mendler-style 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 reduction-preserving embedding into pure F .
(Co-)iteration for higher-order nested datatypes
- POST-CONF. PROC. OF IST WG TYPES 2ND ANN. MEETING, TYPES'02, LECT. NOTES IN COMPUT. SCI
, 2003
"... The problem of defining iteration for higher-order nested datatypes of arbitrary (finite) rank is solved within the framework of System F ω of higher-order 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 higher-order nested datatypes of arbitrary (finite) rank is solved within the framework of System F ω of higher-order 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 rank-2 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 rank-1 type transformers (i. e., functions from types to types) arising as least fixed-points of monotone rank-2 type transformers. Strong normalization is shown by an embedding into F ω. The results dualize to greatest fixed-points, hence to coinductive constructors with coiteration.
Semi-continuous sized types and termination
- Computer Science Logic, 20th International Workshop, CSL 2006, 15th Annual Conference of the EACSL
"... Abstract. A type-based approach to termination uses sized types: an ordinal bound for the size of a data structure is stored in its type. A recursive function over a sized type is accepted if it is visible in the type system that recursive calls occur just at a smaller size. This approach is only so ..."
Abstract
-
Cited by 6 (3 self)
- Add to MetaCart
Abstract. A type-based approach to termination uses sized types: an ordinal bound for the size of a data structure is stored in its type. A recursive function over a sized type is accepted if it is visible in the type system that recursive calls occur just at a smaller size. This approach is only sound if the type of the recursive function is admissible, i.e., depends on the size index in a certain way. To explore the space of admissible functions in the presence of higher-kinded data types and impredicative polymorphism, a semantics is developed where sized types are interpreted as functions from ordinals into sets of strongly normalizing terms. It is shown that upper semi-continuity of such functions is a sufficient semantical criterion for admissibility. To provide a syntactical criterion, a calculus for semi-continuous function is developed. 1
Initial algebra semantics is enough
- Proceedings, Typed Lambda Calculus and Applications
, 2007
"... Abstract. Initial algebra semantics is a cornerstone of the theory of modern functional programming languages. For each inductive data type, it provides a fold combinator encapsulating structured recursion over data of that type, a Church encoding, a build combinator which constructs data of that ty ..."
Abstract
-
Cited by 5 (2 self)
- Add to MetaCart
Abstract. Initial algebra semantics is a cornerstone of the theory of modern functional programming languages. For each inductive data type, it provides a fold combinator encapsulating structured recursion over data of that type, a Church encoding, a build combinator which constructs data of that type, and a fold/build rule which optimises modular programs by eliminating intermediate data of 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. Specifically, the folds have been considered too weak to capture commonly occurring patterns of recursion, and no Church encodings, build combinators, or fold/build rules have been given for nested types. This paper overturns this conventional wisdom by solving all of these problems. 1
Disciplined, Efficient, Generalised Folds for Nested Datatypes
- Information Processing Letters
, 2002
"... Nested (or non-uniform, or non-regular) datatypes have recursive definitions in which the type parameter changes. Their folds are restricted in power due to type constraints. Bird and Paterson introduced generalised folds for extra power, but at the cost of a loss of efficiency: folds may take more ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
Nested (or non-uniform, or non-regular) datatypes have recursive definitions in which the type parameter changes. Their folds are restricted in power due to type constraints. Bird and Paterson introduced generalised folds for extra power, but at the cost of a loss of efficiency: folds may take more than linear time to evaluate. Hinze introduced efficient generalised folds to counter this inefficiency, but did so in a pragmatic way, at the cost of a loss of reasoning power: without categorical or equivalent underpinnings, there are no universal properties for manipulating folds. We combine the efficiency of Hinze's construction with the powerful reasoning tools of Bird and Paterson's.
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 3 (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.
Generating generic functions
- In WGP ’06: Proceedings of the 2006 ACM SIGPLAN workshop on Generic programming
, 2006
"... www.cs.uu.nl ..."
Theoretical Foundations for Practical ‘Totally Functional Programming’
, 2007
"... Interpretation is an implicit part of today’s programming; it has great power but is overused and has
significant costs. For example, interpreters are typically significantly hard to understand and hard
to reason about. The methodology of “Totally Functional Programming” (TFP) is a reasoned
attempt ..."
Abstract
- Add to MetaCart
Interpretation is an implicit part of today’s programming; it has great power but is overused and has
significant costs. For example, interpreters are typically significantly hard to understand and hard
to reason about. The methodology of “Totally Functional Programming” (TFP) is a reasoned
attempt to redress the problem of interpretation. It incorporates an awareness of the undesirability
of interpretation with observations that definitions and a certain style of programming appear to
offer alternatives to it. Application of TFP is expected to lead to a number of significant outcomes,
theoretical as well as practical. Primary among these are novel programming languages to lessen or
eliminate the use of interpretation in programming, leading to better-quality software. However,
TFP contains a number of lacunae in its current formulation, which hinder development of these
outcomes. Among others, formal semantics and type-systems for TFP languages are yet to be
discovered, the means to reduce interpretation in programs is to be determined, and a detailed
explication is needed of interpretation, definition, and the differences between the two. Most
important of all however is the need to develop a complete understanding of the nature of
interpretation. In this work, suitable type-systems for TFP languages are identified, and guidance
given regarding the construction of appropriate formal semantics. Techniques, based around the
‘fold’ operator, are identified and developed for modifying programs so as to reduce the amount of
interpretation they contain. Interpretation as a means of language-extension is also investigated.
v
Finally, the nature of interpretation is considered. Numerous hypotheses relating to it considered in
detail. Combining the results of those analyses with discoveries from elsewhere in this work leads
to the proposal that interpretation is not, in fact, symbol-based computation, but is in fact something
more fundamental: computation that varies with input. We discuss in detail various implications of
this characterisation, including its practical application. An often more-useful property, ‘inherent
interpretiveness’, is also motivated and discussed in depth. Overall, our inquiries act to give
conceptual and theoretical foundations for practical TFP.

