Results 11  20
of
29
Representing Cyclic Structures as Nested Datatypes
"... We show that cyclic structures, i.e., finite or possibly infinite structures with backpointers, unwindable into possibly infinite structures, can be elegantly represented as nested datatypes. This representation is free of the various deficiencies characterizing the more naive representation as mixe ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
We show that cyclic structures, i.e., finite or possibly infinite structures with backpointers, unwindable into possibly infinite structures, can be elegantly represented as nested datatypes. This representation is free of the various deficiencies characterizing the more naive representation as mixedvariant datatypes. It is inspired by the representation of lambdaterms as a nested datatype via the de Bruijn notation. 1
Generic programming with dependent types
 Spring School on Datatype Generic Programming
, 2006
"... In these lecture notes we give an overview of recent research on the relationship ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
In these lecture notes we give an overview of recent research on the relationship
Modular TypeSafety Proofs in Agda
"... Methods for reusing code are widespread and well researched, but methods for reusing proofs are still emerging. We consider the use of dependent types for this purpose, introducing a modular approach for composing mechanized proofs. We show that common techniques for abstracting algorithms over data ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Methods for reusing code are widespread and well researched, but methods for reusing proofs are still emerging. We consider the use of dependent types for this purpose, introducing a modular approach for composing mechanized proofs. We show that common techniques for abstracting algorithms over data structures naturally translate to abstractions over proofs. We introduce a language composed of a series of smaller language components, each defined as functors, and tie them together by taking the fixed point of their sum [Malcom, 1990]. We then give proofs of type preservation for each language component and show how to compose these proofs into a proof for the entire language, again by taking the fixed point of a sum of functors.
Incremental updates for efficient bidirectional transformations
 In International Conference on Functional Programming, Proceedings, volume 46(9) of SIGPLAN Notices
, 2011
"... A bidirectional transformation is a pair of mappings between source and view data objects, one in each direction. When the view is modified, the source is updated accordingly. The key to handling large data objects that are subject to relatively small modifications is to process the updates incremen ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
A bidirectional transformation is a pair of mappings between source and view data objects, one in each direction. When the view is modified, the source is updated accordingly. The key to handling large data objects that are subject to relatively small modifications is to process the updates incrementally. Incrementality has been explored in the semistructured settings of relational databases and graph transformations; this flexibility in structure makes it relatively easy to divide the data into separate parts that can be transformed and updated independently. The same is not true if the data is to be encoded with more generalpurpose algebraic datatypes, with transformations defined as functions: dividing data into welltyped separate parts is tricky, and recursions typically create interdependencies. In this paper, we study transformations that support incremental updates, and devise a constructive process to achieve this incrementality.
The Third Homomorphism Theorem on Trees Downward & Upward Lead to DivideandConquer
"... Parallel programs on lists have been intensively studied. It is well known that associativity provides a good characterization for divideandconquer parallel programs. In particular, the third homomorphism theorem is not only useful for systematic development of parallel programs on lists, but it i ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Parallel programs on lists have been intensively studied. It is well known that associativity provides a good characterization for divideandconquer parallel programs. In particular, the third homomorphism theorem is not only useful for systematic development of parallel programs on lists, but it is also suitable for automatic parallelization. The theorem states that if two sequential programs iterate the same list leftward and rightward, respectively, and compute the same value, then there exists a divideandconquer parallel program that computes the same value as the sequential programs. While there have been many studies on lists, few have been done for characterizing and developing of parallel programs on trees. Naive divideandconquer programs, which divide a tree at the root and compute independent subtrees in parallel, take time that is proportional to the height of the input tree and have poor scalability with respect to the number of processors when the input tree is illbalanced. In this paper, we develop a method for systematically constructing scalable divideandconquer parallel programs on trees, in which two sequential programs lead to a scalable divideandconquer parallel program. We focus on paths instead of trees so as to utilize rich results on lists and demonstrate that associativity provides good characterization for scalable divideandconquer parallel programs on trees. Moreover, we generalize the third homomorphism theorem from lists to trees. We demonstrate the effectiveness of our method with various examples. Our results, being generalizations of known results for lists, are generic in the sense that they work well for all polynomial data structures.
A Notation for Comonads
"... LNCS volume of the postproceedings of IFL’12. Abstract. The categorytheoretic concept of a monad occurs widely as a design pattern for functional programming with effects. The utility and ubiquity of monads is such that some languages provide syntactic sugar for this pattern, further encouraging i ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
LNCS volume of the postproceedings of IFL’12. Abstract. The categorytheoretic concept of a monad occurs widely as a design pattern for functional programming with effects. The utility and ubiquity of monads is such that some languages provide syntactic sugar for this pattern, further encouraging its use. We argue that comonads, the dual of monads, similarly provide a useful design pattern, capturing notions of context dependence. However, comonads remain relatively underused compared to monads—due to a lack of knowledge of the design pattern along with the lack of accompanying simplifying syntax. We propose a lightweight syntax for comonads in Haskell, analogous to the donotation for monads, and provide examples of its use. Via our notation, we also provide a tutorial on programming with comonads. Many algebraic approaches to programming apply concepts from category theory as design patterns for abstracting and structuring programs. For example, the categorytheoretic notion of a monad is widely used to structure programs
Abstract A POPL Pearl Submission Clowns to the Left of me, Jokers to the Right
"... This paper, submitted as a ‘pearl’, introduces a small but useful generalisation to the ‘derivative ’ operation on datatypes underlying Huet’s notion of ‘zipper ’ (Huet 1997; McBride 2001; Abbott et al. 2005b), giving a concrete representation to onehole contexts in data which is in midtransformat ..."
Abstract
 Add to MetaCart
This paper, submitted as a ‘pearl’, introduces a small but useful generalisation to the ‘derivative ’ operation on datatypes underlying Huet’s notion of ‘zipper ’ (Huet 1997; McBride 2001; Abbott et al. 2005b), giving a concrete representation to onehole contexts in data which is in midtransformation. This operator, ‘dissection’, turns a containerlike functor into a bifunctor representing a onehole context in which elements to the left of the hole are distinguished in type from elements to its right. I present dissection for polynomial functors, although it is certainly more general, preferring to concentrate here on its diverse applications. For a start, maplike operations over the functor and foldlike operations over the recursive data structure it induces can be expressed by tail recursion alone. Moreover, the derivative is readily recovered from the dissection, along with Huet’s navigation operations. A further special case of dissection, ‘division’, captures the notion of leftmost hole, canonically distinguishing values with no elements from those with at least one. By way of a more practical example, division and dissection are exploited to give a relatively efficient generic algorithm for abstracting all occurrences of one term from another in a firstorder syntax. The source code for the paper is available online 1 and compiles with recent extensions to the Glasgow Haskell Compiler. 1.
The NetherlandsPullUps, PushDowns, and Passing It Around Exercises in Functional Incrementalization
, 2009
"... Abstract. Programs in functional programming languages with algebraic datatypes are often datatypecentric and use folds or foldlike functions. Incrementalization of such a program can significantly improve its performance. Functional incrementalization separates the recursion from the calculation ..."
Abstract
 Add to MetaCart
Abstract. Programs in functional programming languages with algebraic datatypes are often datatypecentric and use folds or foldlike functions. Incrementalization of such a program can significantly improve its performance. Functional incrementalization separates the recursion from the calculation and significantly reduces redundant computation. In this paper, we motivate incrementalization with a simple example and present a library for transforming programs using upwards, downwards, and circular incrementalization. We also give a datatypegeneric implementation for the library and demonstrate the incremental zipper, a zipper extended with attributes. 1
 ↠L
, 2009
"... I describe the encoding of cut admissibility for rigid logic in order to motivate the problem of case analysis and coverage checking for contexts with holes in themsomething that can be represented as linear functions. I describe several of the reasons this doesn’t work in Celf and Twelf, and also ..."
Abstract
 Add to MetaCart
I describe the encoding of cut admissibility for rigid logic in order to motivate the problem of case analysis and coverage checking for contexts with holes in themsomething that can be represented as linear functions. I describe several of the reasons this doesn’t work in Celf and Twelf, and also why it seems pretty cool despite not existing. Rigid (i.e. noncommutative ordered) logic Consider the nonassociative Lambek calculus, i.e. nonassociative ordered logic. We’ll call it Rigid Logic due to the rigid treelike structure of contexts and because it gets really old referring to the nonassociative Lambek calculus. id
General Terms
"... The theory of combinatorial species, although invented as a purely mathematical formalism to unify much of combinatorics, can also serve as a powerful and expressive language for talking about algebraic data types. With potential applications to automatic test generation, generic programming, and la ..."
Abstract
 Add to MetaCart
The theory of combinatorial species, although invented as a purely mathematical formalism to unify much of combinatorics, can also serve as a powerful and expressive language for talking about algebraic data types. With potential applications to automatic test generation, generic programming, and language design, the theory deserves to be much better known in the functional programming community. This paper aims to teach the theory of combinatorial species, using motivation and examples from the world of functional programming. Although Haskell is used for examples, the ideas can readily be translated into any language with algebraic data types.