Results 1  10
of
17
Dealing with Large Bananas
 Universiteit Utrecht
, 2000
"... Abstract. Many problems call for a mixture of generic and speci c programming techniques. We propose a polytypic programming approach based on generalised (monadic) folds where a separation is made between basic fold algebras that model generic behaviour and updates on these algebras that model spec ..."
Abstract

Cited by 29 (12 self)
 Add to MetaCart
Abstract. Many problems call for a mixture of generic and speci c programming techniques. We propose a polytypic programming approach based on generalised (monadic) folds where a separation is made between basic fold algebras that model generic behaviour and updates on these algebras that model speci c behaviour. We identify particular basic algebras as well as some algebra combinators, and we show how these facilitate structured programming with updatable fold algebras. This blend of genericity and speci city allows programming with folds to scale up to applications involving large systems of mutually recursive datatypes. Finally, we address the possibility of providing generic de nitions for the functions, algebras, and combinators that we propose. 1
Induction and coinduction in sequent calculus
 Postproceedings of TYPES 2003, number 3085 in LNCS
, 2003
"... Abstract. Proof search has been used to specify a wide range of computation systems. In order to build a framework for reasoning about such specifications, we make use of a sequent calculus involving induction and coinduction. These proof principles are based on a proof theoretic (rather than sett ..."
Abstract

Cited by 23 (8 self)
 Add to MetaCart
Abstract. Proof search has been used to specify a wide range of computation systems. In order to build a framework for reasoning about such specifications, we make use of a sequent calculus involving induction and coinduction. These proof principles are based on a proof theoretic (rather than settheoretic) notion of definition [13, 20, 25, 51]. Definitions are akin to (stratified) logic programs, where the left and right rules for defined atoms allow one to view theories as “closed ” or defining fixed points. The use of definitions makes it possible to reason intensionally about syntax, in particular enforcing free equality via unification. We add in a consistent way rules for pre and post fixed points, thus allowing the user to reason inductively and coinductively about properties of computational system making full use of higherorder abstract syntax. Consistency is guaranteed via cutelimination, where we give the first, to our knowledge, cutelimination procedure in the presence of general inductive and coinductive definitions. 1
On functors expressible in the polymorphic typed lambda calculus
 Logical Foundations of Functional Programming
, 1990
"... This is a preprint of a paper that has been submitted to Information and Computation. ..."
Abstract

Cited by 16 (1 self)
 Add to MetaCart
This is a preprint of a paper that has been submitted to Information and Computation.
The visitor pattern as a reusable, generic, typesafe component
 Proceedings of the 23rd ACM SIGPLAN conference on Objectoriented
"... The VISITOR design pattern shows how to separate the structure of an object hierarchy from the behaviour of traversals over that hierarchy. The pattern is very flexible; this very flexibility makes it difficult to capture the pattern formally. We show how to capture the essence of the VISITOR patter ..."
Abstract

Cited by 14 (3 self)
 Add to MetaCart
The VISITOR design pattern shows how to separate the structure of an object hierarchy from the behaviour of traversals over that hierarchy. The pattern is very flexible; this very flexibility makes it difficult to capture the pattern formally. We show how to capture the essence of the VISITOR pattern as a reusable software library, by using advanced type system features appearing in modern objectoriented languages such as Scala. We preserve typesafety statically: no reflection or similar mechanisms are used. The library is generic, in two senses: by types (the traversal return type and the object hierarchy shape) and by strategy (internal versus external control, imperative versus functional behaviour, orthogonal aspects such as tracing and memoisation). Finally, we propose a generalised datatypelike notation, providing a convenient functional decomposition style in objectoriented languages. 1.
A Typetheoretic Reconstruction of the Visitor Pattern
, 2005
"... In objectoriented languages, the Visitor pattern can be used to traverse treelike data structures: a visitor object contains some operations, and the data structure objects allow themselves to be traversed by accepting visitors. In the polymorphic lambda calculus (System F), treelike data structu ..."
Abstract

Cited by 13 (0 self)
 Add to MetaCart
In objectoriented languages, the Visitor pattern can be used to traverse treelike data structures: a visitor object contains some operations, and the data structure objects allow themselves to be traversed by accepting visitors. In the polymorphic lambda calculus (System F), treelike data structures can be encoded as polymorphic higherorder functions. In this paper, we reconstruct the Visitor pattern from the polymorphic encoding by way of generics in Java. We sketch how the quantified types in the polymorphic encoding can guide reasoning about visitors in general.
Parametricity and dependent types
, 2010
"... Reynolds ’ abstraction theorem shows how a typing judgement in System F can be translated into a relational statement (in second order predicate logic) about inhabitants of the type. We obtain a similar result for a single lambda calculus (a pure type system), in which terms, types and their relatio ..."
Abstract

Cited by 11 (1 self)
 Add to MetaCart
Reynolds ’ abstraction theorem shows how a typing judgement in System F can be translated into a relational statement (in second order predicate logic) about inhabitants of the type. We obtain a similar result for a single lambda calculus (a pure type system), in which terms, types and their relations are expressed. Working within a single system dispenses with the need for an interpretation layer, allowing for an unusually simple presentation. While the unification puts some constraints on the type system (which we spell out), the result applies to many interesting cases, including dependentlytyped ones. Categories and Subject Descriptors F.3.3 [Logics and Meanings
Modular visitor components: A practical solution to the expression families problem
 In ECOOP ’09
, 2009
"... Abstract. The expression families problem can be defined as the problem of achieving reusability and composability across the components involved in a family of related datatypes and corresponding operations over those datatypes. Like the traditional expression problem, adding new components (either ..."
Abstract

Cited by 8 (2 self)
 Add to MetaCart
Abstract. The expression families problem can be defined as the problem of achieving reusability and composability across the components involved in a family of related datatypes and corresponding operations over those datatypes. Like the traditional expression problem, adding new components (either variants or operations) should be possible while preserving modular and static typesafety. Moreover, different combinations of components should have different type identities and the subtyping relationships between components should be preserved. By generalizing previous work exploring the connection between typetheoretic encodings of datatypes and visitors, we propose two solutions for this problem in Scala using modular visitor components. These components can be grouped into features that can be easily composed in a featureoriented programming style to obtain customized datatypes and operations. 1
Recursion Versus Iteration at HigherOrders
, 1997
"... . We extend the wellknown analysis of recursionremoval in firstorder program schemes to a higherorder language of finitely typed and polymorphically typed functional programs, the semantics of which is based on callbyname parameterpassing. We introduce methods for recursionremoval, i.e. for ..."
Abstract

Cited by 6 (0 self)
 Add to MetaCart
. We extend the wellknown analysis of recursionremoval in firstorder program schemes to a higherorder language of finitely typed and polymorphically typed functional programs, the semantics of which is based on callbyname parameterpassing. We introduce methods for recursionremoval, i.e. for translating higherorder recursive programs into higherorder iterative programs, and determine conditions under which this translation is possible. Just as finitely typed recursive programs are naturally classified by their orders, so are finitely typed iterative programs. This syntactic classification of recursive and iterative programs corresponds to a semantic (or computational) classification: the higher the order of programs, the more functions they can compute. 1 Background and Motivation Although our analysis is entirely theoretical, as it combines methods from typed calculi, from abstract recursion theory and from denotational semantics, the problems we consider have a strong pra...
Functional polytypic programming  use and implementation
, 1997
"... Abstract Many functions have to be written over and over again for different datatypes, either because datatypes change during the development of programs, or because functions with similar functionality are needed on different datatypes. Examples of such functions are pretty printers, pattern match ..."
Abstract

Cited by 5 (2 self)
 Add to MetaCart
Abstract Many functions have to be written over and over again for different datatypes, either because datatypes change during the development of programs, or because functions with similar functionality are needed on different datatypes. Examples of such functions are pretty printers, pattern matchers, equality functions, unifiers, rewriting functions, etc. Such functions are called polytypic functions. A polytypic function is a function that is defined by induction on the structure of userdefined datatypes. This thesis introduces polytypic functions, shows how to construct and reason about polytypic functions and describes the implementation of the polytypic programming system PolyP. PolyP extends a functional language (a subset of Haskell) with a construct for writing polytypic functions. The extended language type checks definitions of polytypic functions, and infers the types of all other expressions. Programs in the extended language are translated to Haskell.
Typed selfrepresentation
 IN PLDI
, 2009
"... Selfrepresentation – the ability to represent programs in their own language – has important applications in reflective languages and many other domains of programming language design. Although approaches to designing typed program representations for sublanguages of some base language have become ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
Selfrepresentation – the ability to represent programs in their own language – has important applications in reflective languages and many other domains of programming language design. Although approaches to designing typed program representations for sublanguages of some base language have become quite popular recently, the question whether a fully metacircular typed selfrepresentation is possible is still open. This paper makes a big step towards this aim by defining the F ∗ ω calculus, an extension of the higherorder polymorphic lambda calculus Fω that allows typed selfrepresentations. While the usability of these representations for metaprogramming is still limited, we believe that our approach makes a significant step towards a new generation of reflective languages that are both safe and efficient.