Results 1  10
of
20
PolyP  a polytypic programming language extension
 POPL '97: The 24th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages
, 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, debuggers, equality fu ..."
Abstract

Cited by 182 (30 self)
 Add to MetaCart
(Show Context)
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, debuggers, equality functions, unifiers, pattern matchers, 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 paper 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 using an extension of Jones ' theories of qualified types and higherorder polymorphism. The semantics of the programs in the extended language is obtained by adding type arguments to functions in a dictionary passing style. Programs in the extended language are translated to Haskell. 1
Polytypic programming
, 2000
"... ... PolyP extends a functional language (a subset of Haskell) with a construct for defining polytypic functions by induction on the structure of userdefined datatypes. Programs in the extended language are translated to Haskell. PolyLib contains powerful structured recursion operators like catamorp ..."
Abstract

Cited by 94 (11 self)
 Add to MetaCart
(Show Context)
... PolyP extends a functional language (a subset of Haskell) with a construct for defining polytypic functions by induction on the structure of userdefined datatypes. Programs in the extended language are translated to Haskell. PolyLib contains powerful structured recursion operators like catamorphisms, maps and traversals, as well as polytypic versions of a number of standard functions from functional programming: sum, length, zip, (==), (6), etc. Both the specification of the library and a PolyP implementation are presented.
Calculate Polytypically!
 In PLILP'96, volume 1140 of LNCS
, 1996
"... A polytypic function definition is a function definition that is parametrised with a datatype. It embraces a class of algorithms. As an example we define a simple polytypic "crush" combinator that can be used to calculate polytypically. The ability to define functions polytypically adds an ..."
Abstract

Cited by 41 (3 self)
 Add to MetaCart
(Show Context)
A polytypic function definition is a function definition that is parametrised with a datatype. It embraces a class of algorithms. As an example we define a simple polytypic "crush" combinator that can be used to calculate polytypically. The ability to define functions polytypically adds another level of flexibility in the reusability of programming idioms and in the design of libraries of interoperable components.
Monadic Constraint Programming
, 2009
"... A constraint programming system combines two essential components: a constraint solver and a search engine. The constraint solver reasons about satisfiability of conjunctions of constraints, and the search engine controls the search for solutions by iteratively exploring a disjunctive search tree de ..."
Abstract

Cited by 27 (14 self)
 Add to MetaCart
A constraint programming system combines two essential components: a constraint solver and a search engine. The constraint solver reasons about satisfiability of conjunctions of constraints, and the search engine controls the search for solutions by iteratively exploring a disjunctive search tree defined by the constraint program. In this paper we give a monadic definition of constraint programming where the solver is defined as a monad threaded through the monadic search tree. We are then able to define search and search strategies as first class objects that can themselves be built or extended by composable search transformers. Search transformers give a powerful and unifying approach to viewing search in constraint programming, and the resulting constraint programming system is first class and extremely flexible.
Typed Logical Variables in Haskell
 In Proceedings Haskell Workshop
, 2000
"... We describe how to embed a simple typed functional logic programming language in Haskell. The embedding is a natural extension of the Prolog embedding by Seres and Spivey [16]. To get full static typing we need to use the Haskell extensions of quantified types and the STmonad. 1 Introduction O ..."
Abstract

Cited by 19 (0 self)
 Add to MetaCart
(Show Context)
We describe how to embed a simple typed functional logic programming language in Haskell. The embedding is a natural extension of the Prolog embedding by Seres and Spivey [16]. To get full static typing we need to use the Haskell extensions of quantified types and the STmonad. 1 Introduction Over the last ten to twenty years, there have been many attempts to combine the flavours of logic and functional programming [3]. Among these, the most wellknown ones are the programming languages Curry [4], Escher [13], and Mercury [14]. Curry and Escher can be seen as variations on Haskell, where logic programming features are added. Mercury can be seen as an improvement of Prolog, where types and functional programming features are added. All three are completely new and autonomous languages. Defining a new programming language has as a drawback for the developer to build a new compiler, and for the user to learn a new language. A different approach which has gained a lot of popularity ...
PolyLib  a library of polytypic functions
 In Workshop on Generic Programming (WGP'98), Marstrand
, 1998
"... This paper describes the polytypic functions in PolyLib, motivates their presence in the library, and gives a rationale for their design. Thus we hope to share our experience with other researchers in the field. We will assume the reader has some familiarity with the field of polytypic programming. ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
(Show Context)
This paper describes the polytypic functions in PolyLib, motivates their presence in the library, and gives a rationale for their design. Thus we hope to share our experience with other researchers in the field. We will assume the reader has some familiarity with the field of polytypic programming. Of course, a library is an important part of a programming language. Languages like Java, Delphi, Perl and Haskell are popular partly because of their useful and extensive libraries. For a polytypic programming language it is even more important to have a clear and welldesigned library: writing polytypic programs is difficult, and we do not expect many programmers to write polytypic programs. On the other hand, many programmers use polytypic programs such as parser generators, equality functions, etc. This is a first attempt to describe the library of PolyP; we expect that both the form and content of this description will change over time. One of the goals of this paper is to obtain feedback on the library design from other researchers working within the field. At the moment the library only contains the basic
Reusable Monadic Semantics of Logic Programs with Arithmetic Predicates
, 2001
"... We present a combination of modular monadic semantics and generic programming concepts that improves the reusability of semantic specifications. The computational structure is defined as the composition of several monad transformers, where each monad transformer adds a new notion of computation to a ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
We present a combination of modular monadic semantics and generic programming concepts that improves the reusability of semantic specifications. The computational structure is defined as the composition of several monad transformers, where each monad transformer adds a new notion of computation to a given monad. The abstract syntax is defined as the fixed point of several nonrecursive pattern functors. In the case of several syntactic categories, it is possible to define many sorted algebras and ncatamorphisms. As an application, we combine the kernel of a pure logic programming language with independently specified arithmetic expressions obtaining a logic programming language with arithmetic predicates.
A Lightweight Approach to DatatypeGeneric Rewriting
"... Previous implementations of generic rewriting libraries have a number of limitations: they require the user to either adapt the datatype on which rewriting is applied, or the rewriting rules are specified as functions, which makes it hard or impossible to document, test, and analyse them. We describ ..."
Abstract
 Add to MetaCart
(Show Context)
Previous implementations of generic rewriting libraries have a number of limitations: they require the user to either adapt the datatype on which rewriting is applied, or the rewriting rules are specified as functions, which makes it hard or impossible to document, test, and analyse them. We describe a library that demonstrates how to overcome these limitations by defining rules in terms of datatypes, and show how to use a typeindexed datatype to automatically extend a datatype for syntax trees with a case for metavariables. We then show how rewrite rules can be implemented without any knowledge of how the datatype is extended with metavariables. We use Haskell, extended with associated type synonyms, to implement both typeindexed datatypes and generic functions. We analyse the performance of our library and compare it with other approaches to generic rewriting.