Results 11  20
of
41
Comparing Libraries for Generic Programming in Haskell
, 2008
"... Datatypegeneric programming is defining functions that depend on the structure, or “shape”, of datatypes. It has been around for more than 10 years, and a lot of progress has been made, in particular in the lazy functional programming language Haskell. There are more than 10 proposals for generic p ..."
Abstract

Cited by 20 (10 self)
 Add to MetaCart
Datatypegeneric programming is defining functions that depend on the structure, or “shape”, of datatypes. It has been around for more than 10 years, and a lot of progress has been made, in particular in the lazy functional programming language Haskell. There are more than 10 proposals for generic programming libraries or language extensions for Haskell. To compare and characterize the many generic programming libraries in a typed functional language, we introduce a set of criteria and develop a generic programming benchmark: a set of characteristic examples testing various facets of datatypegeneric programming. We have implemented the benchmark for nine existing Haskell generic programming libraries and present the evaluation of the libraries. The comparison is useful for reaching a common standard for generic programming, but also for a programmer who has to choose a particular approach for datatypegeneric programming.
When Do Datatypes Commute?
 Category Theory and Computer Science, 7th International Conference, volume 1290 of LNCS
, 1997
"... Polytypic programs are programs that are parameterised by type constructors (like List), unlike polymorphic programs which are parameterised by types (like Int). In this paper we formulate precisely the polytypic programming problem of "commuting " two datatypes. The precise formulation ..."
Abstract

Cited by 15 (3 self)
 Add to MetaCart
Polytypic programs are programs that are parameterised by type constructors (like List), unlike polymorphic programs which are parameterised by types (like Int). In this paper we formulate precisely the polytypic programming problem of "commuting " two datatypes. The precise formulation involves a novel notion of higher order polymorphism. We demonstrate via a number of examples the relevance and interest of the problem, and we show that all "regular datatypes" (the sort of datatypes that one can define in a functional programming language) do indeed commute according to our specification. The framework we use is the theory of allegories, a combination of category theory with the pointfree relation calculus. 1 Polytypism The ability to abstract is vital to success in computer programming. At the macro level of requirements engineering the successful designer is the one able to abstract from the particular wishes of a few clients a general purpose product that can capture a l...
Polytypic Functions Over Nested Datatypes
 Discrete Mathematics and Theoretical Computer Science
, 1999
"... this article appeared in the proceedings of the 3rd LatinAmerican Conference on Functional Programming (CLaPF'99) ..."
Abstract

Cited by 14 (5 self)
 Add to MetaCart
this article appeared in the proceedings of the 3rd LatinAmerican Conference on Functional Programming (CLaPF'99)
Polytypic Programming With Ease
, 1999
"... A functional polytypic program is one that is parameterised by datatype. Since polytypic functions are defined by induction on types rather than by induction on values they typically operate on a higher level of abstraction than their monotypic counterparts. However, polytypic programming is not nec ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
A functional polytypic program is one that is parameterised by datatype. Since polytypic functions are defined by induction on types rather than by induction on values they typically operate on a higher level of abstraction than their monotypic counterparts. However, polytypic programming is not necessarily more complicated than conventional programming. We show that a polytypic function is uniquely defined by its action on constant functors, projection functors, sums, and products. This information is sufficient to specialize a polytypic function to arbitrary polymorphic datatypes, including mutually recursive datatypes and nested datatypes. The key idea is to use infinite trees as index sets for polytypic functions and to interpret datatypes as algebraic trees. This approach appears both to be simpler, more general, and more efficient than previous ones which are based on the initial algebra semantics of datatypes. Polytypic functions enjoy polytypic properties. We show that wellkno...
Functional correctness proofs of encryption algorithms
 In Proceedings of 12th Conference on Logic for Programming Artificial Intelligence and Reasoning (LPAR 2005), number 3835 in LNAI
, 2005
"... Abstract. We discuss a collection of mechanized formal proofs of symmetric key block encryption algorithms (AES, MARS, Twofish, RC6, Serpent, IDEA, and TEA), performed in an implementation of higher order logic. For each algorithm, functional correctness, namely that decryption inverts encryption, i ..."
Abstract

Cited by 10 (3 self)
 Add to MetaCart
Abstract. We discuss a collection of mechanized formal proofs of symmetric key block encryption algorithms (AES, MARS, Twofish, RC6, Serpent, IDEA, and TEA), performed in an implementation of higher order logic. For each algorithm, functional correctness, namely that decryption inverts encryption, is formally proved by a simple but effective proof methodology involving application of invertibility lemmas in the course of symbolic evaluation. Block ciphers are then lifted to the encryption of arbitrary datatypes by using modes of operation to encrypt lists of bits produced by a polytypic encoding method. 1
Diffusion: Calculating Efficient Parallel Programs
 IN 1999 ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND SEMANTICSBASED PROGRAM MANIPULATION (PEPM ’99
, 1999
"... Parallel primitives (skeletons) intend to encourage programmers to build a parallel program from readymade components for which efficient implementations are known to exist, making the parallelization process easier. However, programmers often suffer from the difficulty to choose a combination of p ..."
Abstract

Cited by 9 (7 self)
 Add to MetaCart
Parallel primitives (skeletons) intend to encourage programmers to build a parallel program from readymade components for which efficient implementations are known to exist, making the parallelization process easier. However, programmers often suffer from the difficulty to choose a combination of proper parallel primitives so as to construct efficient parallel programs. To overcome this difficulty, we shall propose a new transformation, called diffusion, which can efficiently decompose a recursive definition into several functions such that each function can be described by some parallel primitive. This allows programmers to describe algorithms in a more natural recursive form. We demonstrate our idea with several interesting examples. Our diffusion transformation should be significant not only in development of new parallel algorithms, but also in construction of parallelizing compilers.
Transformationbyexample for XML
 PADL 2000, LNCS 1753
, 2000
"... Abstract. xml is a language for describing markup languages for structured data. A growing number of applications that process xml documents are transformers, i.e., programs that convert documents between xml languages. Unfortunately, the current proposals for transformers are complex generalpurpos ..."
Abstract

Cited by 7 (2 self)
 Add to MetaCart
Abstract. xml is a language for describing markup languages for structured data. A growing number of applications that process xml documents are transformers, i.e., programs that convert documents between xml languages. Unfortunately, the current proposals for transformers are complex generalpurpose languages, which will be unappealing as the xml user base broadens and thus decreases in technical sophistication. We have designed and implemented xt3d, a highly declarative xml specification language. It demands little more from users than a knowledge of the expected input and desired output. We illustrate the power of xt3d with several examples, including one reminiscent of polytypic programming that greatly simplifies the import of xml values into generalpurpose languages. 1 XML and Transformations xml [3] is a simplified version of the markup description language sgml. Because of xml’s syntactic simplicity, it is easy to implement rudimentary xml processors and embed them in a variety of devices. As a result, a wide variety of applications are adopting xml as a data representation standard. Declarative programming languages must therefore provide support for xml. They can do better; as this paper demonstrates, ideas from declarative programming can strongly enhance the toolkit that supports xml. Syntactically, xml has a structure similar to other sgmlstyle markup languages such as html. The difference between xml and a language like html is that xml really represents a family of languages. Concretely, xml provides two levels of specification: – An xml element defines a treestructured representation of terms. This representation is rich enough to express a wide variety of data. A sample element, which might represent information about music albums, is <album title="everybody else is doing it, so why can’t we?"> <catalog><num>A043</num><fmt>CD</fmt></catalog>
Final Dialgebras: From Categories to Allegories
 Workshop on Fixed Points in Computer Science
, 1999
"... The study of inductive and coinductive types (like finite lists and streams, respectively) is usually conducted within the framework of category theory, which to all intents and purposes is a theory of sets and functions between sets. Allegory theory, an extension of category theory due to Freyd, is ..."
Abstract

Cited by 6 (3 self)
 Add to MetaCart
The study of inductive and coinductive types (like finite lists and streams, respectively) is usually conducted within the framework of category theory, which to all intents and purposes is a theory of sets and functions between sets. Allegory theory, an extension of category theory due to Freyd, is better suited to modelling relations between sets as opposed to functions between sets. The question thus arises of how to extend the standard categorical results on the existence of final objects in categories (for example, coalgebras and products) to their existence in allegories. The motivation is to streamline current work on generic programming, in which the use of a relational theory rather than a functional theory has proved to be desirable. In this paper, we define the notion of a relational final dialgebra and prove, for an important class of dialgebras, that a relational final dialgebra exists in an allegory if and only if a final dialgebra exists in the underlying category of map...
Functional polytypic programming  use and implementation
, 1997
"... 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, equ ..."
Abstract

Cited by 5 (2 self)
 Add to MetaCart
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.
Generic typepreserving traversal strategies
 PROC. INTERNATIONAL WORKSHOP ON REDUCTION STRATEGIES IN REWRITING AND PROGRAMMING (WRS 2001), VOLUME SPUPV 2359
, 2001
"... A typed model of strategic rewriting with coverage of generic traversals is developed. The corresponding calculus offers, for example, a strategy operator 2 (), which applies the argument strategy to all immediate subterms. To provide a typeful model for generic strategies, one has to identify signa ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
A typed model of strategic rewriting with coverage of generic traversals is developed. The corresponding calculus offers, for example, a strategy operator 2 (), which applies the argument strategy to all immediate subterms. To provide a typeful model for generic strategies, one has to identify signatureindependent, that is, generic types. In the present article, we restrict ourselves to TP  the generic type of all TypePreserving strategies. TP is easily integrated into a standard manysorted type system for rewriting. To inhabit TP, we need to introduce a (leftbiased) typedriven choice operator & ,. The operator applies its left argument (corresponding to a manysorted strategy) if the type of the given term ts, and the operator resorts to the right argument (corresponding to a generic default) otherwise. This approach dictates that the semantics of strategy application must be typedependent to a certain extent.