Results 1 - 10
of
12
PolyP - a polytypic programming language extension
- POPL '97: The 24th ACM SIGPLAN-SIGACT 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 161 (27 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, 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 user-defined 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 higher-order 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
- 2nd Int. School on Advanced Functional Programming
, 1996
"... PolyP extends a functional language (a subset of Haskell) with a construct for defining polytypic functions by induction on the structure of user-defined datatypes. Programs in the extended language are translated to Haskell. PolyLib contains powerful structured recursion operators like catamorphism ..."
Abstract
-
Cited by 86 (12 self)
- Add to MetaCart
PolyP extends a functional language (a subset of Haskell) with a construct for defining polytypic functions by induction on the structure of user-defined 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 another leve ..."
Abstract
-
Cited by 41 (3 self)
- Add to MetaCart
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.
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 ST-monad. 1 Introduction O ..."
Abstract
-
Cited by 13 (0 self)
- Add to MetaCart
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 ST-monad. 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 well-known 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 ...
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 8 (6 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.
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
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 well-designed 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
New Bounds in Parallel Unification
, 2001
"... fMGU(k-depth)g is the family of problems, which contains, for each natural k, MGU restricted to inputs with depth no greater than k. fMGU(k-breadth)g is the family which, for each natural k, contains MGU restricted to inputs with breadth no greater than k. We prove 1 that, for each k? 1, MGU(k- ..."
Abstract
- Add to MetaCart
fMGU(k-depth)g is the family of problems, which contains, for each natural k, MGU restricted to inputs with depth no greater than k. fMGU(k-breadth)g is the family which, for each natural k, contains MGU restricted to inputs with breadth no greater than k. We prove 1 that, for each k? 1, MGU(k-depth) log MGU , and also MGU(k-breadth) log MGU . This shows that bounds either on the depth or on the breadth of the input do not significantly speed up the computation of unification on PRAM machines. The paper concludes with a look at the design of parallel unification algorithms, and at unification on f lat inputs. As a final contribution, we introduce a new algorithm which improves the performance of known algorithms for parallel unification and also computes in polylog PRAM Time on flat inputs. 1
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
- 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 non-recursive pattern functors. In the case of several syntactic categories, it is possible to define many sorted algebras and n-catamorphisms. 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.

